Get which template being in use within WordPress-admin

Basically this isn’t available in admin. You can take a look at my profile, go to my github page and grab the “current admin info” plugin. But this won’t help you much. This would show you the template name: get_page_template_slug( get_queried_object_id() ); On the front end you can use the following plugin, that will display … Read more

Post Bulk Update

1) Create a new page and assign a new page template to it, lets say site.com/update and update.php. Inside of update.php write you bulk mechanism: <?php // grab all your posts $parts = get_posts(array(‘post_type’ => ‘parts’, ‘numberposts’ => -1,)) // loop through every part foreach ( $parts as $part ) { // get part number … Read more

Share Tags Between Custom Posts in Admin

When you register_taxonomy you can simply add an array of post_types to $object_type parameter. From WordPress-codex: (array/string) (required) Name of the object type for the taxonomy object. Object-types can be built-in objects (see below) or any custom post type that may be registered. So you can just add an array of post_types after you run … Read more

What is wrong with this code to remove wp admin bar from one page

You need to remove the (!) infront of the conditional, you can read about PHP-operators here. Now you simply say that if not on page “image-upload” remove the admin_bar.. Here is the working code: <?php function wpse_80018_hide_admin_bar() { // If is on page “image-upload” // Remove the admin_bar if ( is_page(‘image-upload’) ): show_admin_bar(false); endif; } … Read more

Date range filter for manage posts list on edit.php

WordPress support advised me you can use the same parameters on the URL as WP_Query() accepts. http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters You can’t pass a date range. The best you can do is pass specific dates. For example, edit.php?s&post_status=all&post_type=post&action=-1&m=201301&cat=0&post_format=0&paged=1&mode=list&day=1 will show all posts from the 1st day of the current month. When I told this to our content manager … Read more

404 Error on Activate / Deactivate Plugin

For anyone running into a similar problem, it came down to a plugin conflict; in my case Capability Manager Enhanced and Access which is part of the Toolset plugin. Unfortunately no error_log of /var/log/httpd log files were generated as it was an internal permissions conflict within WordPress. If you find yourself in this situation, simply … Read more

jQuery UI inside widget on admin page

Ok, so, for some reason I can’t comprehend, the answer is that the div element containing the tabs should have a class and not an id for jQuery UI to work properly, as such: <div class=”mytabs”> and jQuery(document).ready(function($) { $(“.mytabs”).tabs(); }); Just for the record, the way I enqued the scripts is: add_action( ‘admin_enqueue_scripts’, ‘load_my_admin_js’ … Read more

WordPress Options Page not working

The problem part is this line: <form method=”post” action=”options.php”> This sends your form to wp-admin/options.php (and I guess you’re not sending the form from this URL). Leave the action value empty like this: <form method=”post” action=””> And your form will send itself to the same page from which it was sent. Then you can save … Read more