Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
  • in reply to: Change name of post-type portfolio #126682
     meet
    Participant
    Hey Radu, I did not use that plugin. I got some code and through that I changed the labels of post types.
    add_action( 'wp_loaded', 'renamePostTypeLabel', 20 );
    function renamePostTypeLabel()
    {
        global $wp_post_types;
        $p = 'portfolio';
         
        // Someone has changed this post type, always check for that!
        if ( empty ( $wp_post_types[ $p ] ) or ! is_object( $wp_post_types[ $p ] ) or empty ( $wp_post_types[ $p ]->labels ) ) return;
    
        /*Portfolio*/
        $wp_post_types[ $p ]->labels->name               = 'WikiPOP';
        $wp_post_types[ $p ]->labels->singular_name      = 'WikiPOP';
        $wp_post_types[ $p ]->labels->add_new            = 'Add WikiPOP';
        $wp_post_types[ $p ]->labels->add_new_item       = 'Add new WikiPOP';
        $wp_post_types[ $p ]->labels->all_items          = 'All WikiPOP';
        $wp_post_types[ $p ]->labels->edit_item          = 'Edit WikiPOP';
        $wp_post_types[ $p ]->labels->name_admin_bar     = 'WikiPOP';
        $wp_post_types[ $p ]->labels->menu_name          = 'WikiPOP';
        $wp_post_types[ $p ]->labels->new_item           = 'New WikiPOP';
        $wp_post_types[ $p ]->labels->not_found          = 'No WikiPOP found';
        $wp_post_types[ $p ]->labels->not_found_in_trash = 'No WikiPOP found in trash';
        $wp_post_types[ $p ]->labels->search_items       = 'Search WikiPOP';
        $wp_post_types[ $p ]->labels->view_item          = 'View WikiPOP';
    }
Viewing 1 post (of 1 total)

Log in with your credentials

Forgot your details?