start_controls_section(
'content_section',
array(
'label' => __( 'Settings', 'ultimate-post' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
)
);
$this->add_control(
'saved_template',
array(
'label' => __( 'Saved Template', 'ultimate-post' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => ultimate_post()->get_all_lists( 'ultp_templates' ),
)
);
$this->add_control(
'edit_template',
array(
'type' => \Elementor\Controls_Manager::RAW_HTML,
'raw' => ' ' . __( 'Edit This Template', 'ultimate-post' ) . '',
)
);
$this->add_control(
'add_new_template',
array(
'type' => \Elementor\Controls_Manager::RAW_HTML,
'raw' => ' ' . __( 'Add New Template', 'ultimate-post' ) . '',
)
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$id = $settings['saved_template'];
if ( $id ) {
if ( isset( $_GET['action'] ) || isset( $_POST['action'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.NonceVerification.Recommended
echo ultimate_post()->build_css_for_inline_print( $id, true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --