Support » Fixing WordPress » Edit existing wp admin submenu titles

  • Resolved funnybunny8

    (@funnybunny8)


    On the WordPress admin dashboard there is the menu to the left side with links that show a submenu when you hover over some of them (I am not talking about the main admin menu at the top!). I want to edit the titles of a few specific submenu items. For example, I want to change the “Theme editor” title under the appearance tab to “Theme editor (D)”. I am adding the (D) as a note that this page is mainly used by developers. I have searched the web for how to accomplish this using add_filter or something of that nature, but have only come across adding submenu items, not editing them. Is there a hook or function I can use to accomplish this?
    Thanks!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You could directly alter the label at its source, the global $submenu array. But only after it has been added by WP. Hooking ‘admin_menu’ action late should work. Or “(D)” could be added through custom admin CSS.

    Alternately, you could add code that defines DISALLOW_FILE_EDIT constant as true unless the current user is the developer’s login. Then the editor items wouldn’t even appear at all for other users.

    FWIW, many devs don’t really use those editors anyway, they have a workflow external to WP. It may not bother anyone to disable the editors for all users.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.