start_controls_section(
'section_shortcode',
[
'label' => __( 'Shortcode', 'ajax-load-more' ),
]
);
$this->add_control(
'alm_shortcode',
[
'label' => __( 'Ajax Load More Shortcode', 'ajax-load-more' ),
'type' => Controls_Manager::TEXTAREA,
'default' => __( '[ajax_load_more]', 'ajax-load-more' ),
/* translators: 1: Shortcode Builder link tag. 2: Shortcode Builder closing link tag. */
'description' => __( 'The shortcode will not render while Elementor is in live edit mode, you must preview the page to view Ajax Load More functionality.', 'ajax-load-more' ) .'
» '. sprintf(__('%1$sBuild Shortcode%2$s', 'ajax-load-more' ), '', ''),
'placeholder' => '[ajax_load_more]',
]
);
$this->end_controls_section();
}
/**
* Render the widget output on the frontend.
* Written in PHP and used to generate the final HTML.
*
* @since 1.1.0
*
* @access protected
*/
protected function render() {
$this->add_inline_editing_attributes( 'alm_shortcode', 'none' );
$shortcode = $this->get_settings_for_display( 'alm_shortcode' );
$shortcode = do_shortcode( shortcode_unautop( $shortcode ) );
if( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
echo '