choices; $select2_options = $this->select2_options; $multiple = $this->multiple; $posttype = $this->posttype; if( $posttype ) { $defaults = array( 'post_type' => 'page', 'posts_per_page' => -1, ); $args = wp_parse_args( $this->posttype_args, $defaults ); $choices = array(); if( isset( $this->posttype_empty_first_value ) ) { $choices[''] = $this->posttype_empty_first_value; } $posts = get_posts( $args ); foreach( $posts as $post ) { $choices[$post->ID] = $post->post_title; } } if( $this->templates_builder_templates ) { $choices = array(); $templates = get_option( 'botiga_template_builder_data' ); if ( ! empty( $templates ) ) { $templates = array_filter( $templates, function( $item ) { return 'global' !== $item[ 'id' ]; } ); foreach( $templates as $template ) { $template_id = $template[ 'content' ]; $choices[ $template_id ] = $template[ 'template_name' ]; } } } ?>
label ); ?>
link(); ?> /> value(), ',' ) !== FALSE ) : $values = explode( ',', $this->value() ); $values = array_map( function( $val ){ $newval = esc_js( $val ); return "'$newval'"; }, $values ); ?>