'sp_post_carousel', 'post_status' => 'publish', 'posts_per_page' => 10000, ) ); $posts = $sp_pcp_posts->posts; foreach ( $posts as $post ) { $post_list[ $post->ID ] = $post->post_title; } krsort( $post_list ); return $post_list; } /** * Controls register. * * @return void */ protected function _register_controls() { $this->start_controls_section( 'content_section', array( 'label' => __( 'Content', 'post-carousel' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'sp_smart_post_show_free_shortcode', array( 'label' => __( 'Smart Post Show Shortcode(s)', 'post-carousel' ), 'type' => \Elementor\Controls_Manager::SELECT2, 'label_block' => true, 'default' => '', 'options' => $this->sp_pcp_post_list(), ) ); $this->end_controls_section(); } /** * Render smart post show free shortcode widget output on the frontend. * * @since 2.4.1 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $sp_pcp_shortcode = $settings['sp_smart_post_show_free_shortcode']; if ( '' === $sp_pcp_shortcode ) { echo '