Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

WP-Admin Screen Meta Links WordPress

  • SOLVED

WP community member <em>w-shadow</em> has a great tutorial about [[LINK href="http://w-shadow.com/blog/2010/06/30/add-new-buttons-alongside-screen-options-and-help/"]]adding new buttons alongside “screen options” and “help”[[/LINK]]. The tutorial even provides code samples in a ready to go downloadable script.

The winning answer will help with two things:
1) Modify the script so that it works on any theme page, including a theme options page.

2) Provide a working example of both the orange Feedback and green Upgrade tabs. These tabs should be displayed side-by-side and CSS for the green tab is included in the script.

You can post your code here or on the code snippet service of your choice. :)

Answers (1)

2010-08-26

Michael Fields answers:

Just add the following lines to your theme's functions.php file: [[LINK href="http://wordpress.pastebin.com/fQa0mpsF"]]http://wordpress.pastebin.com/fQa0mpsF[[/LINK]]


Matt Taylor comments:

Michael, thank you for the script. That is exactly what I am looking for except that the tabs are showing on any wp-admin page. How do I show them only on a theme related page?


Michael Fields comments:

I thought that you wanted to use them on all the admin pages? Now that I re-read your posts. It looks like I was wrong.... sorry about that. Could you please post the code that you use to create the admin page - or better yet tell me what string is returned by add_menu_page()?

Basically, you will need to store the output of add_menu_page() in a variable and then you should be able to use this variable in the following function:

add_screen_meta_link(
'my-theme-feedback-link', //Link ID. Should be unique.
'Feedback', //Link text.
'http://example.com/', //URL
$myCustomAdminPage //Where to show the link.
);
<code>add_screen_meta_link(
'my-theme-upgrade-link', //Link ID. Should be unique.
'Upgrade', //Link text.
'http://example.com/', //URL
$myCustomAdminPage //Where to show the link.
);


Now that I understand what you need to do, I don't think that it is really necessary to alter the script at all.


Matt Taylor comments:

Thanks Michael!