\n \n <\/td>\n | \n<\/td>\n <\/tr>\n |
\n <\/td>\n | if( class_exists( 'WP_Customize_Control' ) ):<\/td>\n <\/tr>\n |
\n <\/td>\n | class WP_Customize_Latest_Post_Control extends WP_Customize_Control {<\/td>\n <\/tr>\n |
\n <\/td>\n | public \$type = 'latest_post_dropdown';<\/td>\n <\/tr>\n |
\n <\/td>\n | public \$post_type = 'post';<\/td>\n <\/tr>\n |
\n <\/td>\n | <\/td>\n <\/tr>\n |
\n <\/td>\n | public function render_content() {<\/td>\n <\/tr>\n |
\n <\/td>\n | \n<\/td>\n <\/tr>\n |
\n <\/td>\n | \$latest = new WP_Query( array(<\/td>\n <\/tr>\n |
\n <\/td>\n | 'post_type' =><\/span> \$this-><\/span>post_type,<\/td>\n <\/tr>\n \n <\/td>\n | 'post_status' =><\/span> 'publish',<\/td>\n <\/tr>\n \n <\/td>\n | 'orderby' =><\/span> 'date',<\/td>\n <\/tr>\n \n <\/td>\n | 'order' =><\/span> 'DESC'<\/td>\n <\/tr>\n \n <\/td>\n | ));<\/td>\n <\/tr>\n | \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | ?><\/span><\/td>\n <\/tr>\n \n <\/td>\n | <<\/span>label<\/span>><\/span><\/td>\n <\/tr>\n \n <\/td>\n | <<\/span>span<\/span> class<\/span>="customize-control-title<\/span>"><\/span><?php<\/span> echo<\/span> esc_html( \$<\/span>this<\/span><\/span>->label<\/span> ); ?><\/span></<\/span>span<\/span>><\/span><\/td>\n <\/tr>\n \n <\/td>\n | <<\/span>select<\/span> <?php<\/span> \$<\/span>this<\/span><\/span>->link<\/span>(); ?><\/span>><\/span><\/td>\n <\/tr>\n \n <\/td>\n | <?php<\/span> <\/td>\n <\/tr>\n \n <\/td>\n | while<\/span>( \$<\/span>latest<\/span>->have_posts<\/span>() ) {<\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>latest<\/span>->the_post<\/span>();<\/td>\n <\/tr>\n \n <\/td>\n | echo<\/span> "<option <\/span>" . selected( \$<\/span>this<\/span><\/span>->value<\/span>(), get_the_ID() ) . " value='<\/span>" . get_the_ID() . "'><\/span>" . the_title( ''<\/span>, ''<\/span>, false<\/span> ) . "</option><\/span>";<\/td>\n <\/tr>\n \n <\/td>\n | }<\/td>\n <\/tr>\n | \n <\/td>\n | ?><\/span><\/td>\n <\/tr>\n \n <\/td>\n | </<\/span>select<\/span>><\/span><\/td>\n <\/tr>\n \n <\/td>\n | </<\/span>label<\/span>><\/span><\/td>\n <\/tr>\n \n <\/td>\n | <?php<\/span><\/td>\n <\/tr>\n \n <\/td>\n | }<\/td>\n <\/tr>\n | \n <\/td>\n | }<\/td>\n <\/tr>\n | \n <\/td>\n | endif<\/span>;<\/td>\n <\/tr>\n <\/table>\n<\/div>\n\n\n <\/div>\n\n <\/div>\n<\/div>\n\n <\/div>\n | | | | | | | | | | | | | | | | |