The Love of Code
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] How to remove " ?repeat=w3tc " from query stringUsing version 0.9.3, network activated, and this problem still occurs. (WordPress 3.7.1)
Forum: Plugins
In reply to: [W3 Total Cache] Media Uploads works from Media page, but not from modalNo, it doesn’t. I eventually found that the permissions on the 2013/07 folder were wrong. But what’s weird is that it’s trying to upload to 2013/07 at all. It should be uploading to 2013/09.
Forum: Plugins
In reply to: [Multiple Post Thumbnails] Is it possible to use the new media uploader?Chris,
Can you tell us more about this pull request? Will this code ever make it into the published plugin? I was hoping that this most recent update would add support for the WP 3.5 media selector, but it doesn’t seem to have done so.
Answered my own question. WordPress 3.5 adds a new permission called “create_posts” and one must add “create_wpbdp_listings” as a permission.
Forum: Plugins
In reply to: Getting menu name in a given locationThe three functions you’ll need to use are these:
- get_registered_nav_menus()
- wp_get_nav_menus()
- get_nav_menu_locations()
get_registered_nav_menus: This will give you a list of locations. The array keys will be the location slugs, and the array values will the location names.
wp_get_nav_menus: This will give you a list of menus the (presumably) the user created. The array will be full of objects. These are really just taxonomies.
get_nav_menu_locations: This will give you the information key to what you’re looking for. The keys of the returned array will be the location slug, and the values of the returned array will be the taxonomy IDs of menu.
How to get the menu that belongs to a given location:
$locations = get_registered_nav_menus(); $menus = wp_get_nav_menus(); $menu_locations = get_nav_menu_locations(); $location_id = 'riddell-shop'; if (isset($menu_locations[ $location_id ])) { foreach ($menus as $menu) { // If the ID of this menu is the ID associated with the location we're searching for if ($menu->term_id == $menu_locations[ $location_id ]) { // This is the correct menu // Get the items for this menu $menu_items = wp_get_nav_menu_items($menu); // Now do something with them here. // // break; } } } else { // The location that you're trying to search doesn't exist }
I hope that helps.
Forum: Fixing WordPress
In reply to: Get wp_insert_post_data to run ON-PUBLISH-bump-