Last active
October 12, 2023 15:19
-
-
Save hbaker/edd05135ea9089f09c1983901df5e405 to your computer and use it in GitHub Desktop.
Divi Theme - Rename Divi's 'Projects' Custom Post Type
This file contains hidden or 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
// RENAME DIVI PROJECTS CUSTOM POST TYPE | |
function ze_rename_projects_cpt() { | |
register_post_type( 'project', | |
array( | |
'labels' => array( | |
'name' => __( 'Specials', 'divi' ), // CHANGE SPECIALS TO WHATEVER YOU WANT | |
'singular_name' => __( 'Special', 'divi' ), // CHANGE SPECIAL TO WHATEVER YOU WANT | |
), | |
'has_archive' => true, | |
'hierarchical' => true, | |
'public' => true, | |
'rewrite' => array( 'slug' => 'special', 'with_front' => false ), // CHANGE SPECIAL TO WHAT YOU WANT YOUR SLUG TO BE | |
'menu_icon' => 'dashicons-tag', // CHANGE TO AN ICON TO MATCH YOUR NEW POST TYPE | |
'supports' => array(), | |
)); | |
} | |
add_action( 'init', 'ze_rename_projects_cpt' ); | |
// END RENAME DIVI PROJECTS CUSTOM POST TYPE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A better way would be to use the filter register_post_type_args. Something like this: