# wp-ultimate-post-grid/1.7.2/helpers/vafpress/vafpress_shortcode_whitelist.php

WP Ultimate Post Grid, version 1.7.2. 26 lines.

- Page: https://pluginprobe.com/plugins/wp-ultimate-post-grid/1.7.2/code/helpers/vafpress/vafpress_shortcode_whitelist.php
- Raw: https://pluginprobe.com/plugins/wp-ultimate-post-grid/1.7.2/raw/helpers/vafpress/vafpress_shortcode_whitelist.php
- Modified: 2015-09-29T13:38:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-ultimate-post-grid/1.7.2/code/helpers/vafpress/vafpress_shortcode_whitelist.php#L10-L20`.

```php
<?php
function wpupg_shortcode_generator_grids_by_date()
{
    $args = array(
        'post_type' => WPUPG_POST_TYPE,
        'post_status' => 'any',
        'posts_per_page' => -1,
        'nopaging' => true,
    );

    $query = new WP_Query( $args );
    $posts = $query->have_posts() ? $query->posts : array();
    $grids = array();

    foreach ( $posts as $post )
    {
        $grids[] = array(
            'value' => $post->post_name,
            'label' => $post->post_title,
        );
    }

    return $grids;
}

VP_Security::instance()->whitelist_function('wpupg_shortcode_generator_grids_by_date');
```
