| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Included by Beaver Builder inside the module render method; variables are local. |
| 4 |
$id = $settings->template;//phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?> |
| 5 |
<div class="ultp-shortcode" data-postid="<?php echo esc_attr( $id ); ?>"> |
| 6 |
<?php |
| 7 |
if ( $id ) { |
| 8 |
$args = array( |
| 9 |
'p' => $id, |
| 10 |
'post_type' => 'ultp_templates', |
| 11 |
); |
| 12 |
$the_query = new \WP_Query( $args ); |
| 13 |
if ( $the_query->have_posts() ) { |
| 14 |
while ( $the_query->have_posts() ) { |
| 15 |
$the_query->the_post(); |
| 16 |
the_content(); |
| 17 |
} |
| 18 |
wp_reset_postdata(); |
| 19 |
} |
| 20 |
} elseif ( isset( $_GET['fl_builder'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only Beaver Builder editor detection. |
| 21 |
//phpcs:ignore |
| 22 |
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 |
| 23 |
|
| 24 |
} |
| 25 |
?> |
| 26 |
</div> |
| 27 |
|