| 1 |
<?php $id = $settings->template;//phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?> |
| 2 |
<div class="ultp-shortcode" data-postid="<?php echo esc_attr( $id ); ?>"> |
| 3 |
<?php |
| 4 |
if ( $id ) { |
| 5 |
$args = array( |
| 6 |
'p' => $id, |
| 7 |
'post_type' => 'ultp_templates', |
| 8 |
); |
| 9 |
$the_query = new \WP_Query( $args ); |
| 10 |
if ( $the_query->have_posts() ) { |
| 11 |
while ( $the_query->have_posts() ) { |
| 12 |
$the_query->the_post(); |
| 13 |
the_content(); |
| 14 |
} |
| 15 |
wp_reset_postdata(); |
| 16 |
} |
| 17 |
} elseif ( isset( $_GET['fl_builder'] ) ) { |
| 18 |
//phpcs:ignore |
| 19 |
echo '<p style="text-align:center;">' . sprintf( esc_html__( 'Pick a Template from your saved ones. Or create a template from: %s.', 'ultimate-post' ) . ' ', '<strong><i>' . esc_html__( 'Dashboard > PostX > Saved Templates', 'ultimate-post' ) . '</i></strong>' ) . '</p>'; //phpcs:ignore |
| 20 |
|
| 21 |
} |
| 22 |
?> |
| 23 |
</div> |
| 24 |
|