Uname: Linux premium264.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.3.22 [ PHP INFO ] PHP os: Linux
Server Ip: 69.57.162.13
Your Ip: 216.73.216.219
User: workvvfb (1129) | Group: workvvfb (1084)
Safe Mode: OFF
Disable Function:
NONE

name : wpr-custom-meta-keys.php
<?php
namespace WprAddons\Classes\Modules;

use Elementor\Utils;
use Elementor\Group_Control_Image_Size;
use WprAddons\Classes\Utilities;


if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * WPR_Custom_Meta_Keys setup
 *
 * @since 3.4.6
 */

 class WPR_Custom_Meta_Keys {

    public function __construct() {
        add_action('wp_ajax_wpr_get_custom_meta_keys' , [$this, 'get_custom_meta_keys']);
        add_action('wp_ajax_nopriv_wpr_get_custom_meta_keys',[$this, 'get_custom_meta_keys']);
    }

    public function get_custom_meta_keys() {

        $nonce = $_POST['nonce'];

        if ( !wp_verify_nonce( $nonce, 'wpr-addons-editor-js' ) ) {
            return; // Get out of here, the nonce is rotten!
        }

        $keys = Utilities::get_custom_meta_keys();

        if ( empty( $keys ) ) {
            wp_send_json_error( 'No keys found' );
        } else {
            wp_send_json_success( wp_json_encode($keys[0]) );
        }
    }
 }

 new WPR_Custom_Meta_Keys();
© 2025 GrazzMean