Articles of wp parse args

when the incoming url is a query, in which function does WP begin to work with it?

I need to debug a problem with filters I have in place. they’re affecting any url that includes a query; eg, http://my.domain.hk/?attachment=1. does anyone know in which function WP begins to work with this kind of url, one that includes a query? cheers, Gregory

Creating a Search Array From Multiple Tables

I’m working with a client’s WordPress site that has user submissions (via TDO Mini Forms) from multiple countries, and they would like to be able to search for posts by region – Europe, Africa, Central America, etc. There is a custom field already in place for the user’s country of origin. I also have a […]

wp_parse_args & category parameter

Am trying to use this code: function wp_custom_archive($args = ”) { global $wpdb, $wp_locale; $defaults = array( ‘cat’ => 6, //doing nothing ‘format’ => ‘html’, ‘show_post_count’ => true, ‘echo’ => 1 ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); if ( ” != $limit ) { $limit = absint($limit); $limit = ‘ […]

Using wp_parse_args to set up Plugin Default Settings

So I want to have defaults set up for each of my plugins settings, and I’m using wp_parse_args to do so which I believe is the correct way, but I’m hitting a roadblock. Here’s my code at the moment: function eddslider_options_each( $edd_slider_options ) { $edd_slider_options = get_option( ‘eddslider_options’ ); /** * Define the array of […]

Custom Taxonomy Archive BUG

I’m hoping that Its just my tired eyes missing something and a fresh pair of eyeballs might catch what I’m missing. I have a custom taxonomy with a slug of ‘residential_project_types’ that is assigned to a custom post type of residential_projects. I want to display all terms from the taxonomy, outputting the term name and […]

How to orderby meta_value_num with dollar ($) sign

The custom fields all have prices including $ signs, and a dot as separator. $theQuery = new WP_Query(array( ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘price’, ‘order’ => ASC )); All formatted like this: $24.95 $190.00 $1.40 They won’t sort correctly due to the dollar sign, is it possible to ignore or remove the first character / […]

Ajax form filter post by custom fields

I’m currently working on a site where users can search for apartments. I have a custom post type for the apartment posts, which contain several custom fields. I have a page where i list all of the apartments. What i want to do is have a form, containing check boxes, drop-downs and radio button, where […]

How to implement time filter to show random post 1 month for one category and 3 months for other categories

I started to work on one website after another developer and there is problem with his “popular widget” which is basically showing 3 random posts from category. There is some Switch statement which is regulating to show from category news 3 random post not older then 1 month and for other categories 3 month. I […]

How to modify a taxonomy that's already registered

Today I needed to change the arguments on a custom taxonomy that was already registered by a third party plugin. Specifically I wanted to set the show_admin_column argument to true and change the rewrite slug so that it wasn’t just the taxonomy slug. In this case, it was a “People” post type with a “People […]