WordPress Answers Weekly Newsletter
WordPress Answers Weekly Newsletter

Top new questions this week:

How to prevent a post from being deleted?

For auditing issue, I only want a post can be trashed, but not deleted - for all users. So I have a plugin like add_action('before_delete_post', function($id) { wp_die(0); }); But …

<plugins> <posts> <user-roles> <permissions> <cms>  
asked by Yoga 5 votes
answered by t f 3 votes

Why doesn't /2013/01/ properly return January's archives in archive.php?

I've figured out how to implement pagination into WordPress archives, etc.., but the content isn't being returned correctly. Instead of /2013/01/ returning January 2013's archives, it instead returns …

<theme-development> <loop>  
asked by Donovan Glover 4 votes
answered by Milo 7 votes

Display attachments by ID in a wp.media frame

I'm trying to use the new wp.media uploader frame for an app I'm building. I've read up a lot on other questions, blog posts, etc etc. The code I pasted below is working already quite fine and even …

<uploads> <javascript> <media> <backbone>  
asked by Adal 3 votes
answered by dalbaeb 0 votes

Comments screen in backend, how to disable email address of commenter for non admins

I'm trying to configure the comments screen in the backend to fit my project. I've already been able to take a first step by resolving this question: Comments screen in backend, how to disable Quick …

<comments>  
asked by user27309 3 votes
answered by toscho 2 votes

How to create custom taxonomy URLs without taxonomy name?

I have a website that lists businesses in different cities (this is a niche site, so all businesses have the same "classification"). For starters I created a CPT for locations and a taxonomy called …

<customization> <wordpress.org>  
asked by Condalator 2 votes
answered by Manny Fleurmond 0 votes

How can one utilize a variable as a callback function name for add_settings_field

I'm trying to cut down on the amount of code that is in my theme options function. I'm adding my settings like so: add_settings_field($k,$v,$callback,$the_options,$the_group,$args); This works for …

<php> <functions> <theme-options> <callbacks> <add-settings-field>  
asked by Starfs 2 votes
answered by toscho 1 vote

Add Admin Menu Inside Construct or Init

I thought I was making headway in my WordPress Development education until I ran across the Boilerplate for WordPress plugins and it uses a class object. I'm fine with that and understand those …

<plugin-development> <admin-menu> <settings-api>  
asked by ClockwiseQ 2 votes
answered by toscho 3 votes

Greatest hits from previous weeks:

Get terms by taxonomy AND post_type

I have 2 custom post types 'bookmarks' and 'snippets' and a shared taxonomy 'tag'. I can generate a list of all terms in the taxonomy with get_terms(), but I can't figure out how to limit the list to …

<custom-post-types> <custom-taxonomy> <terms>  
asked by Gavin Hewitt 6 votes
answered by Braydon 4 votes

How to use wp_nav_menu to create a select menu dropdown?

I'm using the following inside the wp_nav_menu function to create a select dropdown menu where each menu item is an option in the select dropdown... 'items_wrap' => …

<dropdown> <select> <menus>  
asked by Chris Molitor 13 votes
answered by One Trick Pony 11 votes

Can you answer these?

Unable to delete custom post types, confusion around capabilities

So I'm working on a plugin for creating a questions/answers system that's as simple and well-integrated as possible (not unlike this site) but am stuck at the creation of the custom post types. You …

<plugins> <custom-post-types> <plugin-development> <capabilities>  
asked by Josh K 1 vote

Sorting a specific taxonomy by archive date using URL

OK, so I'm looking for a way to sort a specific taxonomy by archive date using the site URL. Say the custom taxonomy ("sort") value is "fruit" then then you would currently get all the posts marked …

<filters> <taxonomy> <archives>  
asked by thatgerhard 1 vote

Default permalink changes

I need to use in my permalinks same titles for different post types and as far as I know the slug must be unique so the permalinks cannot be: custom-post-type-1/hello-world …

<permalinks>  
asked by Sergiu B 1 vote
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3