build_css_for_inline_print( $templates, true ); } $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(); the_content(); $output .= ob_get_clean(); } wp_reset_postdata(); } } elseif ( isset( $_GET['vc_editable'] ) ) { // @codingStandardsIgnoreLine $output .= '
' . sprintf( esc_html__( 'Pick a Template from your saved ones. Or create a template from: %s.', 'ultimate-post' ) . ' ', '' . esc_html__( 'Dashboard > PostX > Saved Templates', 'ultimate-post' ) . '' ) . '
'; } return $output; } public static function map() { return array( 'name' => esc_html__( 'PostX Template', 'ultimate-post' ), 'description' => esc_html__( 'PostX Templates for WPBakery.', 'ultimate-post' ), 'base' => 'postx_wpbakery_widget', 'icon' => ULTP_URL . '/addons/wpbakery/wpbakery.png', 'params' => array( array( 'type' => 'dropdown', 'heading' => esc_html__( 'Select Your Template', 'ultimate-post' ), 'param_name' => 'saved_template', 'value' => array_flip( ultimate_post()->get_all_lists( 'ultp_templates', 'empty' ) ), 'description' => esc_html__( 'Pick a Template from your saved ones. Or create a template from: "Dashboard > PostX > Saved Templates"', 'ultimate-post' ), ), ), ); } } } new PostX_WPBakery_Widget();