Change admin post thumbnail size for custom post type only

admin_post_thumbnail_size takes three parameters: $thumb_size: selected Thumb Size if you do nothing in the filter. $thumbnail_id: Thumbnail attachment ID. $post: associated WP_Post instance So you may make use of these parameters to have a better control in your CODE. Use the CODE like below: function custom_admin_thumb_size( $thumb_size, $thumbnail_id, $post ) { if( ‘slider’ === $post->post_type … Read more

How to add a link to the tax term in the admin Edit page?

The dynamic hook {taxonomy}_term_edit_form_top can be used to output a link to the term’s archive page. Since we’re dealing with terms under the genre taxonomy, we will attach our callback to the genre_term_edit_form_top hook. /** * Adds a link to top of edit term form for terms under the * genre taxonomy. * * @param … Read more

WordPress manage users as non admin

First off, there is no generic “manage users” ability. There are several individual abilities under that rubric. See http://codex.wordpress.org/Roles_and_Capabilities Anyway, you have a couple options. You can add certain capabilities to existing users or you can create a new custom role with the capabilities you need. If a brand new role is needed, one can … Read more

How to put placeholder text in the main post input area?

You can change ‘post’ to which ever post type you want to apply the default content to. add_filter( ‘default_content’, ‘wpse57907_default_content’, 10, 2 ); function wpse57907_default_content( $content, $post ) { if ( ‘post’ == $post->post_type ) $content=”Use this area to write an introduction to the course…”; return $content; } Edit I’m not sure you can add … Read more

Is there an action that is called when a post is restored from the trash?

There are multiple actions. Listed in order of appearance with their parameters: untrash_post – (int) $post_id // before restoring transition_post_status – (string) $new_status, ‘trash’, (object) $post trash_to_{$new_status} – (object) $post // useful to address a special trash to status action untrash_post_comments – (int) $post_id // before associated comments are untrashed untrashed_post_comments – (int) $post_id // … Read more

How to add_filter/action to comment out CSS generated by admin function?

I think you can do it like this: function my_admin_bar_init() { remove_action(‘wp_head’, ‘_admin_bar_bump_cb’); } add_action(‘admin_bar_init’, ‘my_admin_bar_init’); Add this to your functions.php file. It will disable outputting of these inline styles in <head> section but the wp_admin_bar will be still available. If you would like to disable wp_admin_bar entirely, you can do it like this: remove_action( … Read more

Actions that Run on Admin Edit Page Load After Posts Are Queried

What actions run on the edit page in the admin section of a post type Here are the do_action and do_action_ref_array calls, for the edit.php (post) screen, without any plugins and with a default theme activated: muplugins_loaded – do_action registered_taxonomy – do_action registered_taxonomy – do_action registered_taxonomy – do_action registered_taxonomy – do_action registered_taxonomy – do_action registered_post_type … Read more