You must rename the "Records" in the admin panel to any of your name. I use the code:

function edit_admin_menus() { global $menu; global $submenu; $menu[5][0] = 'Книги'; $submenu['edit.php'][5][0] = 'ВсС ΠΊΠ½ΠΈΠ³ΠΈ'; $submenu['edit.php'][10][0] = 'Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΊΠ½ΠΈΠ³Ρƒ'; } add_action( 'admin_menu', 'edit_admin_menus' ); function change_post_object_label() { global $wp_post_types; $labels = &$wp_post_types['post']->labels; $labels->name = 'Книги'; $labels->singular_name = 'Книги'; $labels->add_new = 'Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΊΠ½ΠΈΠ³Ρƒ'; $labels->add_new_item = 'Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΊΠ½ΠΈΠ³Ρƒ'; $labels->edit_item = 'Π˜Π·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ ΠΊΠ½ΠΈΠ³Ρƒ'; $labels->new_item = 'Книга'; $labels->view_item = 'ΠŸΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ ΠΊΠ½ΠΈΠ³Ρƒ'; $labels->search_items = 'Π˜ΡΠΊΠ°Ρ‚ΡŒ ΠΊΠ½ΠΈΠ³Ρƒ'; $labels->not_found = 'НичСго Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½ΠΎ'; $labels->not_found_in_trash = 'ΠšΠΎΡ€Π·ΠΈΠ½Π° пуста'; } 

Top panel

However, the old item remains in the top panel in the "Add" tab. There is a solution?

  • 2
    IMHO. It was easier to "rename" in langpack. wordpress.org/plugins/loco-translate to help. Or ru.wordpress.org/plugins/say-what - SeVlad
  • Thanks for the info, but the question is still relevant - I don’t really like plugins. (Usually, I use no more than 5). - Bareza 2:51 pm
  • Pluginophobia is treated by the study of materiel. Just this need to be done not in the subject, and the plugin (or not - another question). All these lines are set in translations (langpacks). It is possible to replace langpack without a plug-in (too lazy to google a function, but it is also in plug-ins). But to make it .. Well, you can use a hard drive or other unattended software. Komsomol members have their quirks in hammocks .. - SeVlad

2 answers 2

To change the item in the top menu, enter the line name_admin_bar :

 $labels->name_admin_bar = 'ΠšΠ½ΠΈΠ³Ρƒ'; 

    This method changes the item only in the admin panel. The site will be recording again.

     $labels->name_admin_bar = 'ΠšΠ½ΠΈΠ³Ρƒ'; 

    In general, I solved this question with a crutch:

     $('#wp-admin-bar-new-post').find('a').html('ΠšΠ½ΠΈΠ³Ρƒ'); 
    • For the given fragment, it is not clear at what point the function change_post_object_label() called. If you tie it to an action that is performed on the outer part of the site - for example, init - the item will change there as well. - SergeyBiryukov