Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
92 views
in Technique[技术] by (71.8m points)

Editing the WordPress Admin Menus

This is a 2 part question.

  1. I followed this guide to be able to change an admin menu item, but what is the process to find out what the WordPress menu key is? I am using this theme but the developer has stopped support and would like to change careers menu and submenu labels.

  2. Once the above is done, how to change the hard coded slug & breadcrumbs to match the new menu item?

The goal is to edit the naming structure associated with this but keep its functionality. I found in the theme > Admin > theme_functions.php the code it uses for this part but not sure how to override this in the child theme?

Any help would be great.

if( 'career' == $post_type ){
        $slug = get_option('tommusrhodus_careers_slug', 'careers');
        $home .= '<li class="active"><a href="' . esc_url( home_url( "/". $slug ."/" ) ) . '">' . esc_html__( 'Careers', 'stack' ) . '</a></li>';
    }
question from:https://stackoverflow.com/questions/65916889/editing-the-wordpress-admin-menus

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could simply use this plugin that has a UI to change everything: https://wordpress.org/plugins/admin-menu-editor/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...