开发者 | mwtsn |
---|---|
更新时间 | 2014年10月24日 20:30 |
PHP版本: | 3.3 及以上 |
WordPress版本: | 4.0 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
/wp-content/plugins/
directoryIt is: 'commodity_products'
It is also called: 'commodity_category'
Those are:
So that they can be found quicker by queries, the discounts use the discount code that you set as part of the meta key. You can access them like so:
These work exactly the same as the 'Discounts' meta box, apart from you can get them using get_option()
.
You can use:
This function provides arguments for you to filter the products (or your own post types) creating a custom Loop. You can use it like so:
get_posts( commodity_query_arguements( $args ) );
It accepts the following arguments as an array (or you can leave the $args empty to use the defaults):
$defaults = array( 'featured' => false, // [ true | false ] - Set to true to return posts that have the featured post custom meta data set to true 'featured_post_meta_key' => '_commodity_featured', // The custom meta field that identifies the featured post, will also accept an array 'order' => 'ASC', // [ ASC | DESC ] 'orderby' => 'date', // [ date | menu_order | title ] 'posts_per_page' => 5, // Set number of posts to return, -1 will return all 'post_type' => 'commodity_products', // [ post | page | custom post type | array() ] 'taxonomy_filter' => false, // [ true | false ] - Set to true to filter by taxonomy 'taxonomy_key' => 'commodity_category', // The key of the taxonomy we wish to filter by 'taxonomy_terms' => 'volunteer', // The terms (uses slug), will accept a string or array 'use_featured_image' => false // [ true | false ] - Set to true to only use posts with a featured image ); get_posts( commodity_query_arguements( $defaults ) );
Sure thing, the GitHub repository is right here: https://github.com/mwtsn/commodity