| @@ -44,37 +44,14 @@ | ||
| 44 | 44 | return $original_content; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Get the elementor document by page ID. | |
| 49 | - * | |
| 50 | - * @since 1.2.20 | |
| 51 | - * | |
| 52 | - * @param int $post_id The current post ID. | |
| 53 | - * @return object Elementor document. | |
| 54 | - */ | |
| 55 | - public static function get_elementor_document( $post_id ) { | |
| 56 | - if ( defined( 'ELEMENTOR_VERSION' ) && class_exists( '\Elementor\Plugin' ) ) { | |
| 57 | - $document = \Elementor\Plugin::$instance->documents->get( (int) $post_id ); | |
| 58 | - } else { | |
| 59 | - $document = null; | |
| 60 | - } | |
| 61 | - | |
| 62 | - return $document; | |
| 63 | - } | |
| 64 | - | |
| 65 | - /** | |
| 66 | 48 | * Check if a page is being edited by elementor. |
| 67 | 49 | * |
| 68 | 50 | * @return bool |
| 69 | 51 | */ |
| 70 | 52 | public static function is_elementor( $post_id ) { |
| 71 | - $document = self::get_elementor_document( $post_id ); | |
| 72 | - | |
| 73 | - if ( empty( $document ) ) { | |
| 74 | - return false; | |
| 75 | - } | |
| 76 | - | |
| 53 | + $document = \Elementor\Plugin::$instance->documents->get( $post_id ); | |
| 77 | 54 | return $document->is_built_with_elementor(); |
| 78 | 55 | } |
| 79 | 56 | |
| 80 | 57 | /** |