Allow Renaming of Posts and Pages

[ad_1]

Hi, I normally add to my functions.php file to rename Posts to Articles as per below. However, this stopped working when this plugin is active.

// Rename Posts to Articles
/* ------------------------------------- */
add_action( 'init', 'change_post_object_label' );
function change_post_menu_label() {
    global $menu;
    global $submenu;
    $menu[5][0]                 = 'Articles';
    $submenu['edit.php'][5][0]  = 'All Articles';
    $submenu['edit.php'][10][0] = 'Add New Article';
    $submenu['edit.php'][16][0] = 'Artical Tags';
    echo '';
}
 
add_action( 'admin_menu', 'change_post_menu_label' );
function change_post_object_label() {
    global $wp_post_types;
    $labels                     = &$wp_post_types['post']->labels;
    $labels->name="Articles";
    $labels->singular_name="Article";
    $labels->add_new            = 'Add New Article';
    $labels->add_new_item       = 'Add New Article';
    $labels->edit_item          = 'Edit Article';
    $labels->new_item           = 'Article';
    $labels->view_item          = 'View Article';
    $labels->search_items="Search Articles";
    $labels->not_found          = 'No articles found';
    $labels->not_found_in_trash="No articles found in Trash";
}
 
add_action( 'admin_bar_menu', 'change_wp_admin_bar', 80 );
function change_wp_admin_bar( $wp_admin_bar ) {
    $new_post_node        = $wp_admin_bar->get_node( 'new-post' );
    $new_post_node->title="Article";              // Change title
    $wp_admin_bar->add_node( $new_post_node );      // Update Node
}
/* ------------------------------------- */

Could you please advise how to get this working again while still using the plugin?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer