shortcode_name = 'adminz_search_cpt'; $xxx->shortcode_title = 'Search CPT'; $xxx->shortcode_icon = 'text'; $xxx->shortcode_compile = false; $xxx->options = [ 'post_type' => array( 'type' => 'select', 'heading' => __('Post type'), 'default' => 'post', 'config' => array( 'multiple' => true, 'placeholder' => 'Select..', 'options' => get_post_types() ), ), 'style' => array( 'type' => 'select', 'heading' => __('Style'), 'options' => array( '' => 'Normal', 'flat' => 'Flat', ) ), 'size' => array( 'type' => 'radio-buttons', 'heading' => __('Size'), 'default' => 'medium', 'options' => require(get_template_directory() . '/inc/builder/shortcodes/values/text-sizes.php'), 'on_change' => array( 'class' => 'is-{{ value }}' ) ), 'advanced_options' => require(get_template_directory() . '/inc/builder/shortcodes/commons/advanced.php'), ]; $xxx->shortcode_callback = function ($atts, $content = null) { extract(shortcode_atts(array( 'post_type' => 'post', 'size' => 'normal', 'style' => '', 'class' => '', 'visibility' => '' ), $atts)); $classes = array('searchform-wrapper', 'ux-search-box', 'relative', 'adminz_search_cpt'); if ($class) $classes[] = $class; if ($visibility) $classes[] = $visibility; if ($style) $classes[] = 'form-' . $style; if ($size) $classes[] = 'is-' . $size; $classes = implode(' ', $classes); ob_start(); echo '