| @@ -94,8 +94,12 @@ | ||
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | public function get_saved_templates( $params = [] ) { |
| 98 | + if ( ! function_exists( 'is_plugin_active' ) ){ | |
| 99 | + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); | |
| 100 | + } | |
| 101 | + | |
| 98 | 102 | $_page_number = isset( $params['page'] ) ? intval( $params['page'] ) : 1; |
| 99 | 103 | |
| 100 | 104 | $args = [ |
| 101 | 105 | 'post_type' => 'elementor_library', |
| @@ -128,11 +132,13 @@ | ||
| 128 | 132 | wp_reset_postdata(); |
| 129 | 133 | wp_reset_query(); |
| 130 | 134 | |
| 131 | 135 | return array( |
| 132 | - 'current_page' => $templates->query_vars['paged'], | |
| 133 | - 'total_page' => $templates->max_num_pages, | |
| 134 | - 'items' => $templateList, | |
| 136 | + 'current_page' => $templates->query_vars['paged'], | |
| 137 | + 'total_page' => $templates->max_num_pages, | |
| 138 | + 'items' => $templateList, | |
| 139 | + 'has_elementor' => rest_sanitize_boolean( \is_plugin_active( 'elementor/elementor.php' ) ), | |
| 140 | + 'has_elementor_pro' => rest_sanitize_boolean( \is_plugin_active( 'elementor-pro/elementor-pro.php' ) ), | |
| 135 | 141 | ); |
| 136 | 142 | } |
| 137 | 143 | |
| 138 | 144 | private function get_export_link( $template_id ) { |