PATH:
home
/
lab2454c
/
foreclass.com
/
wp-content
/
plugins
/
search-replace-for-elementor
/
inc
/
admin
<?php /** * Plugin global search page. * * @package ELEMSNR * @copyright Copyright (c) 2023, Developry Ltd. * @license https://www.gnu.org/licenses/gpl-2.0.html GNU Public License * @since 1.0 */ namespace ELEMSNR; ! defined( ABSPATH ) || exit; // Exit if accessed directly. // The slug for the global page. define( __NAMESPACE__ . '\ELEMSNR_GLOBAL_PAGE', 'elemsnr-global' ); /** * Add the global page to the admin menu. */ function elemsnr_global_menu() { add_submenu_page( 'elementor', esc_html__( 'Global Search', 'search-replace-for-elementor' ), esc_html__( 'Search and Replace', 'search-replace-for-elementor' ), 'manage_options', ELEMSNR_GLOBAL_PAGE, __NAMESPACE__ . '\elemsnr_global_page' ); } add_action( 'admin_menu', __NAMESPACE__ . '\elemsnr_global_menu', 1000 ); /** * Display the global page layout. */ function elemsnr_global_page() { require_once ELEMSNR_PLUGIN_DIR_PATH . 'inc/admin/views/nav.php'; require_once ELEMSNR_PLUGIN_DIR_PATH . 'inc/admin/views/global-form.php'; } /** * Get an array with all available post types including posts and pages. */ function elemsnr_get_post_types() { $types = array_merge( array( 'post' => 'post', 'page' => 'page', ), get_post_types( array( 'public' => true, '_builtin' => false, ), 'names', 'and' ) ); return $types; } /** * Get all posts passed by post type. */ function elemsnr_get_all_posts( $post_type ) { if ( ! $post_type ) { return false; } $posts = get_posts( array( 'post_type' => $post_type, 'post_status' => 'publish', 'numberposts' => -1, ) ); if ( empty( $posts ) ) { return false; } // Check if there're any Elementor posts with posts. $check = false; foreach ( $posts as $post ) { if ( get_post_meta( $post->ID, '_elementor_edit_mode', true ) ) { $check = true; } } // Return posts if there's at least 1 Elementor type post. if ( $posts && $check ) { return $posts; } return false; }
[-] options.php
[edit]
[+]
..
[-] admin.php
[edit]
[-] requirements.php
[edit]
[-] backup.php
[edit]
[+]
views
[-] global.php
[edit]