Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- ** Get Stores in admin customizer
- **/
- function wps_store_get_store_admin($return_id = false, $args = array(), $array_keys = false) {
- $stores = array();
- $defaults = array(
- 'post_type' => 'store',
- 'post_status' => 'publish',
- 'posts_per_page' => -1,
- 'orderby' => WPS()->stores_order_by,
- 'order' => WPS()->stores_order,
- 'meta_query' => array(
- 'relation' => 'AND',
- array(
- 'key' => '_exclude_store',
- 'compare' => 'EXISTS',
- ),
- array(
- 'key' => '_exclude_store',
- 'value' => '0',
- )
- ),
- );
- $args = apply_filters('wps_store_query_args', wp_parse_args($args, $defaults));
- $query = new WP_Query($args);
- // if($query->have_posts()) {
- // while ($query->have_posts()) : $query->the_post();
- // if ($array_keys) {
- // $stores[] = array(
- // 'id' => get_the_ID(),
- // 'name' => $query->post->post_title
- // );
- // } else {
- // if(!$return_id) {
- // $stores[$query->post->post_title] = $query->post->post_title;
- // } else {
- // $stores[get_the_ID()] = $query->post->post_title;
- // }
- // }
- // endwhile;
- // wp_reset_postdata();
- // }
- return $stores;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement