AI Verified

Name

Change post name in dashboard

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

ActionSkills

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://actionskills.co

History

Last modified:

31/05/2024

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Change post name in dashboard

 
                    
1// Function to change "posts" to "news" in the admin side menu
2function change_post_menu_label() {
3 global $menu;
4 global $submenu;
5 $menu[5][0] = 'Insects';
6 $submenu['edit.php'][5][0] = 'Insects';
7 $submenu['edit.php'][10][0] = 'Add New Insect';
8 $submenu['edit.php'][16][0] = 'Tags';
9 echo '';
10}
11add_action( 'admin_menu', 'change_post_menu_label' );
12// Function to change post object labels to "news"
13function change_post_object_label() {
14 global $wp_post_types;
15 $labels = &$wp_post_types['post']->labels;
16 $labels->name = 'Insects';
17 $labels->singular_name = 'Insect';
18 $labels->add_new = 'Add Insect';
19 $labels->add_new_item = 'Add Insect';
20 $labels->edit_item = 'Edit Insect';
21 $labels->new_item = 'Insect';
22 $labels->view_item = 'View Insect';
23 $labels->search_items = 'Search Insect';
24 $labels->not_found = 'No Insect found';
25 $labels->not_found_in_trash = 'No Insect found in Trash';
26}
27add_action( 'init', 'change_post_object_label' );
28 
29function bks_replace_admin_menu_icons_css() {
30 ?>
31 <style>
32 .dashicons-admin-post:before {
33 font-family: "dashicons";
34 content: "\f451" !important;
35 }
36 </style>
37 <?php
38}
39 
40add_action( 'admin_head', 'bks_replace_admin_menu_icons_css' );

0

Related Snippets

Please see some snippets below related to this snippet..

General

AI Verified

0

Demo

Added: 1 year ago

Last Updated: 1 year ago

Demo

General

AI Verified

0

Format date

Added: 9 months ago

Last Updated: 9 months ago

General

AI Verified

0

remove extra image sizes

Added: 1 year ago

Last Updated: 9 months ago

<p>suspend extra image sizes from showing up</p>

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

Unverified

0

Disable Comments

Added: 9 months ago

Last Updated: 3 weeks ago

General

AI Verified

0

Remove tag and category taxonomy

Added: 9 months ago

Last Updated: 9 months ago

Divi Builder

Unverified

0

Divi - Disable Project CPT and Taxonomy

Added: 9 months ago

Last Updated: 3 weeks ago