| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | if ( ! defined( 'ABSPATH' ) ) { |
| 12: | exit; |
| 13: | } |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | abstract class EPL_Elementor_Listing_Document extends \Elementor\Modules\Library\Documents\Container { |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | public static function get_properties() { |
| 32: | $properties = parent::get_properties(); |
| 33: | $properties['support_conditions'] = false; |
| 34: | return $properties; |
| 35: | } |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | |
| 41: | protected function register_controls() { |
| 42: | parent::register_controls(); |
| 43: | |
| 44: | $this->start_controls_section( |
| 45: | 'epl_template_settings', |
| 46: | array( |
| 47: | 'label' => esc_html__( 'EPL Template Settings', 'easy-property-listings' ), |
| 48: | 'tab' => \Elementor\Controls_Manager::TAB_SETTINGS, |
| 49: | ) |
| 50: | ); |
| 51: | |
| 52: | $this->add_control( |
| 53: | 'epl_preview_listing', |
| 54: | array( |
| 55: | 'label' => esc_html__( 'Preview Listing ID', 'easy-property-listings' ), |
| 56: | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 57: | 'default' => '', |
| 58: | 'description' => esc_html__( 'Optional. Show a specific listing on the editor canvas instead of an automatically selected one.', 'easy-property-listings' ), |
| 59: | 'render_type' => 'template', |
| 60: | ) |
| 61: | ); |
| 62: | |
| 63: | $this->end_controls_section(); |
| 64: | } |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | |
| 70: | |
| 71: | |
| 72: | |
| 73: | |
| 74: | |
| 75: | public function save( $data ) { |
| 76: | $result = parent::save( $data ); |
| 77: | |
| 78: | if ( $result ) { |
| 79: | update_post_meta( $this->post->ID, '_epl_elementor_template_context', 'listing' ); |
| 80: | } |
| 81: | |
| 82: | return $result; |
| 83: | } |
| 84: | } |
| 85: | |