I am looking for a snippet function to replace the default "Edit Page" text that shows in the Wordpress toolbar.
I have disabled it on the backend altogether, because I am using a frontend builder for Editing pages and I want clients to understand which button does what. On the frontend I only have two options for an admin in the Toolbar > "Edit Page", "Edit Frontend". I want to change "Edit Page" to Edit Backend.
The "Edit Backend" text I think will suffice in the concept for where "Edit Page" would be "Edit Post", "Edit Product", etc. since the Frontend Builder handles all post types.
I would like a function snippet so I can leave the Wordpress core alone and updates are seamless.
I'm new here too, so thanks for listening and the help! You have already helped me learn a lot from other searches, but I now officially have an account.
UPDATE:
I wanted this snippet to just reflect when viewing the frontend of the site while logged in. The official code I've used to achieve this is below.
(I just wrapped Dylan's code in the is_admin)
The reason for this was frontend editors. I want it to be simple on the frontend saying "Edit Frontend" or "Edit Backend".
// Change The Edit Toolbar Text "Edit" to "Edit Backend"
add_action('wp_before_admin_bar_render', 'change_admin_bar',999);
function change_admin_bar() {
if ( ! is_admin() ) {
global $wp_admin_bar;
$wp_admin_bar->remove_node('edit');
$args = array(
'id' => 'edit',
'title' => 'Edit Backend',
'href' => get_edit_post_link(),
);
$wp_admin_bar->add_node($args);
}
}
I'm not sure if I misunderstood the question, but from what I gathered, you actually wanted to change the text of the WordPress admin bar so I've written up some code that can be placed in your functions.php file to do just that.
add_action('wp_before_admin_bar_render', 'change_admin_bar',999);
function change_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->remove_node('edit');
$args = array(
'id' => 'edit',
'title' => 'Edit Backend',
'href' => get_edit_post_link(),
);
$wp_admin_bar->add_node($args);
}
Here are some sources for further research: http://sumtips.com/2011/03/customize-wordpress-admin-bar.html http://codex.wordpress.org/Plugin_API/Action_Reference/wp_before_admin_bar_render http://codex.wordpress.org/Class_Reference/WP_Admin_Bar/add_node