| @@ -60,16 +60,13 @@ | ||
| 60 | 60 | BuilderHooks::instance(); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | BuilderCpt::instance(); |
| 64 | - | |
| 65 | - $this->elementor_init(); | |
| 66 | - $this->both_builder_frontend(); | |
| 67 | - | |
| 68 | - // add_action( 'elementor/init', [ $this, 'elementor_init' ] ); | |
| 69 | - add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'editor_scripts' ] ); | |
| 70 | - // add_action( 'template_redirect', [ $this, 'both_builder_frontend' ], 99 ); | |
| 71 | - | |
| 64 | + if ( defined( 'ELEMENTOR_VERSION' ) ) { | |
| 65 | + $this->elementor_init(); | |
| 66 | + $this->both_builder_frontend(); | |
| 67 | + add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'editor_scripts' ] ); | |
| 68 | + } | |
| 72 | 69 | // RT Select2 Ajax. |
| 73 | 70 | add_action( 'wp_ajax_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] ); |
| 74 | 71 | add_action( 'wp_ajax_nopriv_rtsb_select2_object_search', [ $this, 'select2_ajax_posts_filter_autocomplete' ] ); |
| 75 | 72 | // Select2 ajax save data. |