Skip to content

Instantly share code, notes, and snippets.

@yozzi
Created November 16, 2015 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yozzi/c8c5fb5c9937d0af0598 to your computer and use it in GitHub Desktop.
Save yozzi/c8c5fb5c9937d0af0598 to your computer and use it in GitHub Desktop.
Function to change a plugin icon
//Modify Timeline CPT
function wpse_65075_modify_timeline_menu_icon( $post_type, $args ) {
// Make sure we're only editing the post type we want
if ( 'te_announcements' != $post_type )
return;
// //Get labels and update them
// $labels = get_post_type_labels( get_post_type_object( $post_type ) );
// $labels->name = 'Some things';
// $labels->singular_name= 'Some thing';
//
// //update args
// $args->labels = $labels;
// $args->label = $labels->name;
// Set menu icon
$args->menu_icon = 'dashicons-clock';
// Modify post type object
$wp_post_types[$post_type] = $args;
}
add_action( 'registered_post_type', 'wpse_65075_modify_timeline_menu_icon', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment