# wp-ultimate-post-grid/2.5.0/helpers/meta_boxes/meta_box_shortcode.php

WP Ultimate Post Grid, version 2.5.0. 20 lines.

- Page: https://pluginprobe.com/plugins/wp-ultimate-post-grid/2.5.0/code/helpers/meta_boxes/meta_box_shortcode.php
- Raw: https://pluginprobe.com/plugins/wp-ultimate-post-grid/2.5.0/raw/helpers/meta_boxes/meta_box_shortcode.php
- Modified: 2015-04-15T08:46:56+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/2.5.0/code/helpers/meta_boxes/meta_box_shortcode.php#L10-L20`.

```php
<?php
// Grid should never be null. Construct just allows easy access to WPUPG_Grid functions in IDE.
if( is_null( $grid ) ) $grid = new WPUPG_Grid(0);
?>

<?php
if( $grid->post()->post_status !== 'publish' ) {
    _e( 'You have to publish the grid first.', 'wp-ultimate-post-grid' );
} else {
?>
    <strong>Grid</strong><br/>
    [wpupg-grid id="<?php echo $grid->post()->post_name; ?>"]
    <?php
    if( $grid->filter_type() !== 'none' ) {
    ?>
    <br/><br/>
    <strong>Filter</strong><br/>
    [wpupg-filter id="<?php echo $grid->post()->post_name; ?>"]
    <?php } ?>
<?php } ?>
```
