You appear to be a bot. Output may be restricted
Description
Implement "load-edit.php" action for oik-idsDefines the filters and hooks for sortable ID column on post, page and CPT admin screens There really is no need to add a filter for each post type if we can find out what post type we're currently displaying. For edit.php we can query the 'post_type field', except when it's the 'post' type when the value is not set. Note: according to (some) documentation 'manage_posts_columns' is for non-hierarchical post types 'manage_pages_columns' is for hierarchical. No need to find out… just define actions for both.
Usage
oik_ids_load_edit_php();
Parameters
Returns
voidSource
File name: oik/oik-ids.phpLines:
1 to 12 of 12
function oik_ids_load_edit_php() { add_filter( 'manage_posts_columns', 'oik_ids_column' ); add_action( 'manage_posts_custom_column', 'oik_ids_value', 1000, 2 ); add_filter( 'manage_pages_columns', 'oik_ids_column' ); add_action( 'manage_pages_custom_column', 'oik_ids_value', 1000, 2 ); $ptype = bw_array_get( $_REQUEST, "post_type", null ); if ( $ptype ) { add_filter("manage_edit-{$ptype}_sortable_columns", "oik_ids_sortable_column" ); } else { add_filter("manage_edit-post_sortable_columns", "oik_ids_sortable_column" ); } }View on GitHub View on Trac