name = esc_html__( 'PostX Template', 'ultimate-post' );
$this->icon_path = plugin_dir_path( __FILE__ ) . 'icon.svg';
}
function get_fields() {
return array(
'templates' => array(
'label' => esc_html__( 'Select Your Template', 'ultimate-post' ),
'type' => 'select',
'options' => ultimate_post()->get_all_lists( 'ultp_templates', 'none' ),
'default' => 'none',
'description' => esc_html__( 'Pick a Template from your saved ones. Or create a template from: Dashboard > PostX > Saved Templates', 'ultimate-post' ),
),
);
}
function render( $attrs, $render_slug, $content = null ) {
$templates = $this->props['templates'];
$output = '';
$content = '';
$body_class = get_body_class();
if ( $templates && $templates != 'none' ) {
$args = array(
'p' => $templates,
'post_type' => 'ultp_templates',
);
$the_query = new \WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
ob_start();
if ( in_array( 'et-fb', $body_class ) ) {
echo ultimate_post()->build_css_for_inline_print( $templates, true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --