-
-
Save mannieschumpert/e11faa9e6b544dd2d13d to your computer and use it in GitHub Desktop.
Gist for fernando
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
<?php | |
//cria reviewss | |
function create_reviews_cpt() { | |
register_post_type( 'reviews', | |
array( | |
'public' => true, | |
'has_archive' => true, | |
'menu_position' => 5, // places menu item directly below Posts | |
'menu_icon' => '', | |
'labels' => array( | |
'name' => __( 'Reviews' ), | |
'singular_name' => __( 'Review' ), | |
'add_new' => __( 'Add New' ), | |
'add_new_item' => __( 'Add New Review' ), | |
'edit' => __( 'Edit' ), | |
'edit_item' => __( 'Edit Review' ), | |
'new_item' => __( 'New Review' ), | |
'view' => __( 'View Review' ), | |
'view_item' => __( 'View Review' ), | |
'search_items' => __( 'Search Review' ), | |
'not_found' => __( 'No Reviews found' ), | |
'not_found_in_trash' => __( 'No Reviews found in Trash' ), | |
'parent' => __( 'Parent Review' ), | |
), | |
) | |
); | |
} | |
add_action( 'init', 'create_reviews_cpt' ); | |
//cria novidades | |
function create_novidades_cpt() { | |
register_post_type( 'novidades', | |
array( | |
'public' => true, | |
'has_archive' => true, | |
'menu_position' => 6, // places menu item directly below Posts | |
'menu_icon' => '', | |
'labels' => array( | |
'name' => __( 'Novidades' ), | |
'singular_name' => __( 'Novidade' ), | |
'add_new' => __( 'Add New' ), | |
'add_new_item' => __( 'Add New Novidade' ), | |
'edit' => __( 'Edit' ), | |
'edit_item' => __( 'Edit Novidade' ), | |
'new_item' => __( 'New Novidade' ), | |
'view' => __( 'View Novidade' ), | |
'view_item' => __( 'View Novidade' ), | |
'search_items' => __( 'Search Novidade' ), | |
'not_found' => __( 'No Novidades found' ), | |
'not_found_in_trash' => __( 'No Novidades found in Trash' ), | |
'parent' => __( 'Parent Novidade' ), | |
), | |
) | |
); | |
} | |
add_action( 'init', 'create_novidades_cpt' ); | |
//cria promos | |
function create_promos_cpt() { | |
register_post_type( 'promos', | |
array( | |
'public' => true, | |
'has_archive' => true, | |
'menu_position' => 7, // places menu item directly below Posts | |
'menu_icon' => '', | |
'labels' => array( | |
'name' => __( 'Promos' ), | |
'singular_name' => __( 'Promos' ), | |
'add_new' => __( 'Add New' ), | |
'add_new_item' => __( 'Add New Promo' ), | |
'edit' => __( 'Edit' ), | |
'edit_item' => __( 'Edit Promo' ), | |
'new_item' => __( 'New Promo' ), | |
'view' => __( 'View Promo' ), | |
'view_item' => __( 'View Promo' ), | |
'search_items' => __( 'Search Promo' ), | |
'not_found' => __( 'No Promos found' ), | |
'not_found_in_trash' => __( 'No Promos found in Trash' ), | |
'parent' => __( 'Parent Promo' ), | |
), | |
) | |
); | |
} | |
add_action( 'init', 'create_promos_cpt' ); | |
function add_menu_icons_styles(){ | |
?> | |
<style> | |
#adminmenu .menu-icon-reviews div.wp-menu-image:before { | |
content: "\f125"; | |
} | |
#adminmenu .menu-icon-novidades div.wp-menu-image:before { | |
content: "\f125"; | |
} | |
#adminmenu .menu-icon-promos div.wp-menu-image:before { | |
content: "\f125"; | |
} | |
</style> | |
<?php | |
} | |
add_action( 'admin_head', 'add_menu_icons_styles' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment