Site icon WordPress Magyarország

Bejegyzés és oldal id meghatározása bővítmény nélkül

[sourcecode language=”php”]
add_filter(‘manage_posts_columns’, ‘kw_posts_columns_id’, 5);
add_action(‘manage_posts_custom_column’, ‘kw_posts_custom_id_columns’, 5, 2);
add_filter(‘manage_pages_columns’, ‘kw_posts_columns_id’, 5);
add_action(‘manage_pages_custom_column’, ‘kw_posts_custom_id_columns’, 5, 2);
function kw_posts_columns_id($defaults){
$defaults[‘wps_post_id’] = __(‘ID’);
return $defaults;
}
function kw_posts_custom_id_columns($column_name, $id){
if($column_name === ‘wps_post_id’){
echo $id;
}
}

[/sourcecode]

Exit mobile version