| 1 |
<?php |
| 2 |
function wpupg_shortcode_generator_grids_by_date() |
| 3 |
{ |
| 4 |
$args = array( |
| 5 |
'post_type' => WPUPG_POST_TYPE, |
| 6 |
'post_status' => 'any', |
| 7 |
'posts_per_page' => -1, |
| 8 |
'nopaging' => true, |
| 9 |
); |
| 10 |
|
| 11 |
$query = new WP_Query( $args ); |
| 12 |
$posts = $query->have_posts() ? $query->posts : array(); |
| 13 |
$grids = array(); |
| 14 |
|
| 15 |
foreach ( $posts as $post ) |
| 16 |
{ |
| 17 |
$grids[] = array( |
| 18 |
'value' => $post->post_name, |
| 19 |
'label' => $post->post_title, |
| 20 |
); |
| 21 |
} |
| 22 |
|
| 23 |
return $grids; |
| 24 |
} |
| 25 |
|
| 26 |
VP_Security::instance()->whitelist_function('wpupg_shortcode_generator_grids_by_date'); |