Skip to content

Instantly share code, notes, and snippets.

@brandondove
Created April 4, 2012 18:38
Show Gist options
  • Save brandondove/2304600 to your computer and use it in GitHub Desktop.
Save brandondove/2304600 to your computer and use it in GitHub Desktop.
<?php
$new_args = array(
'post_type' => 'shopp_product',
'orderby' => 'date',
'posts_per_page' => 15,
'tax_query' => array(
array(
'taxonomy' => 'shopp_category',
'field' => 'id',
'terms' => shopp( 'collection', 'id', 'return=true' )
)
)
);
$new_products = new WP_Query( $new_args );
pring_r( $new_products );
WP_Query Object
(
[query_vars] => Array
(
[post_type] => shopp_product
[orderby] => date
[posts_per_page] => 15
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => shopp_category
[field] => id
[terms] => 17
)
)
[error] =>
[m] => 0
[p] => 0
[post_parent] =>
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] =>
[static] =>
[pagename] =>
[page_id] => 0
[second] =>
[minute] =>
[hour] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[comments_popup] =>
[meta_key] =>
[meta_value] =>
[preview] =>
[s] =>
[sentence] =>
[fields] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
[ignore_sticky_posts] =>
[suppress_filters] =>
[cache_results] => 1
[update_post_term_cache] => 1
[update_post_meta_cache] => 1
[nopaging] =>
[comments_per_page] => 50
[no_found_rows] =>
[taxonomy] => shopp_category
[term_id] => 17
[order] => DESC
)
[tax_query] => WP_Tax_Query Object
(
[queries] => Array
(
[0] => Array
(
[taxonomy] => shopp_category
[terms] => Array
(
[0] => 17
)
[include_children] => 1
[field] => id
[operator] => IN
)
)
[relation] => AND
)
[meta_query] => WP_Meta_Query Object
(
[queries] => Array
(
)
[relation] =>
)
[post_count] => 1
[current_post] => -1
[in_the_loop] =>
[comment_count] => 0
[current_comment] => -1
[found_posts] => 1
[max_num_pages] => 1
[max_num_comment_pages] => 0
[is_single] =>
[is_preview] =>
[is_page] =>
[is_archive] => 1
[is_date] =>
[is_year] =>
[is_month] =>
[is_day] =>
[is_time] =>
[is_author] =>
[is_category] =>
[is_tag] =>
[is_tax] => 1
[is_search] =>
[is_feed] =>
[is_comment_feed] =>
[is_trackback] =>
[is_home] =>
[is_404] =>
[is_comments_popup] =>
[is_paged] =>
[is_admin] =>
[is_attachment] =>
[is_singular] =>
[is_robots] =>
[is_posts_page] =>
[is_post_type_archive] => 1
[query_vars_hash] => f0d1fc73333f17175f22a93fbb83d84a
[query_vars_changed] =>
[thumbnails_cached] =>
[query] => Array
(
[post_type] => shopp_product
[orderby] => date
[posts_per_page] => 15
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => shopp_category
[field] => id
[terms] => 17
)
)
)
[request] =>
[posts] => Array
(
[0] => WPDatabaseObject Object
(
[_position:DatabaseObject:private] => 0
[_properties:DatabaseObject:private] => Array
(
)
[_ignores:DatabaseObject:private] => Array
(
[0] => _
)
[_map:protected] => Array
(
)
[_table] => allura_posts
[_key] => id
[_datatypes] => Array
(
[ID] => int
[post_date] => date
[post_date_gmt] => date
[post_content] => string
[post_title] => string
[post_excerpt] => string
[post_status] => string
[post_name] => string
[to_ping] => string
[pinged] => string
[post_modified] => date
[post_modified_gmt] => date
[post_content_filtered] => string
[post_type] => string
)
[_lists] => Array
(
)
[ID] => -42
[post_date] =>
[post_date_gmt] =>
[post_content] =>
[post_title] =>
[post_excerpt] =>
[post_status] => publish
[post_name] =>
[to_ping] =>
[pinged] =>
[post_modified] =>
[post_modified_gmt] =>
[post_content_filtered] =>
[post_type] => post
[comment_status] => closed
[filter] => raw
)
)
[post] => WPDatabaseObject Object
(
[_position:DatabaseObject:private] => 0
[_properties:DatabaseObject:private] => Array
(
)
[_ignores:DatabaseObject:private] => Array
(
[0] => _
)
[_map:protected] => Array
(
)
[_table] => allura_posts
[_key] => id
[_datatypes] => Array
(
[ID] => int
[post_date] => date
[post_date_gmt] => date
[post_content] => string
[post_title] => string
[post_excerpt] => string
[post_status] => string
[post_name] => string
[to_ping] => string
[pinged] => string
[post_modified] => date
[post_modified_gmt] => date
[post_content_filtered] => string
[post_type] => string
)
[_lists] => Array
(
)
[ID] => -42
[post_date] =>
[post_date_gmt] =>
[post_content] =>
[post_title] =>
[post_excerpt] =>
[post_status] => publish
[post_name] =>
[to_ping] =>
[pinged] =>
[post_modified] =>
[post_modified_gmt] =>
[post_content_filtered] =>
[post_type] => post
[comment_status] => closed
[filter] => raw
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment