json[ 'value' ] = ( '' == $this->value() ) ? json_encode( [ 0 ] ) : $this->value(); $args = array( 'post_type' => 'page', 'posts_per_page' => -1 ); $pages = get_posts( $args ); $this->json[ 'pages' ] = array( 'Please Select a Page' ); if( $pages && is_array( $pages ) ){ foreach( $pages as $p ) { $this->json[ 'pages' ][ $p->ID ] = $p->post_title; } } $this->json[ 'link' ] = $this->get_link(); $this->json[ 'id' ] = $this->id; $this->json[ 'limit' ] = $this->limit; $this->json[ 'pro_link' ] = $this->pro_link; $this->json[ 'pro_text' ] = $this->pro_text; $this->json[ 'description' ] = $this->description; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @since Bizart 1.0 */ protected function content_template() { ?>