Created
November 16, 2015 01:52
-
-
Save yozzi/c8c5fb5c9937d0af0598 to your computer and use it in GitHub Desktop.
Function to change a plugin icon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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