json[ 'value' ] = ( '' == $this->value() ) ? json_encode( [ 0 ] ) : $this->value(); $args = array( 'post_type' => 'page', 'posts_per_page' => -1 ); $pages = get_posts( $args ); $select_pages = array( esc_html__( 'Select page', 'bizline' ) ); if( $pages && is_array( $pages ) ){ foreach( $pages as $p ) { $select_pages[ $p->ID ] = $p->post_title; } } $this->json[ 'pages' ] = $select_pages; $this->json[ 'link' ] = $this->get_link(); $this->json[ 'id' ] = $this->id; $this->json[ 'limit' ] = $this->limit; $this->json[ 'repeat' ] = $this->repeat; } /** * 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()}. * * @access protected * @since 1.0.0 * * @package Bizline WordPress Theme */ protected function content_template() { ?>