*/ class Ace_User_Management_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * Register the stylesheets for the admin area. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Ace_User_Management_Loader as all of the hooks are defined * in that particular class. * * The Ace_User_Management_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/ace-user-management-admin.css', array(), $this->version, 'all' ); wp_enqueue_style( $this->plugin_name.'-fontawesome', plugin_dir_url( __FILE__ ) . 'css/ace-fontawesome.css', array(), $this->version, 'all' ); if( sanitize_text_field( $_GET['page'] ) == 'ace-custom-field' ){ wp_enqueue_style( $this->plugin_name.'-bootstrap', plugin_dir_url( __FILE__ ) . 'css/bootstrap.min.css', array(), $this->version, 'all' ); wp_enqueue_style( $this->plugin_name.'-fontawesome', plugin_dir_url( __FILE__ ) . 'css/ace-fontawesome.css', array(), $this->version, 'all' ); } } /** * Register the JavaScript for the admin area. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Ace_User_Management_Loader as all of the hooks are defined * in that particular class. * * The Ace_User_Management_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/ace-user-management-admin.js', array( 'jquery' ), $this->version, false ); wp_localize_script( $this->plugin_name, 'ajax', array( 'url' => admin_url( 'admin-ajax.php' )) ); if( sanitize_text_field( $_GET['page'] ) == 'ace-custom-field' ){ wp_enqueue_script( $this->plugin_name.'-bootjs', plugin_dir_url( __FILE__ ) . 'js/ace-bootstrap.min.js', array(), $this->version, 'all' ); wp_enqueue_script( $this->plugin_name.'-jquery-core', get_site_url() . '/wp-includes/js/jquery/ui/core.min.js', array(), $this->version, 'all' ); wp_enqueue_script( $this->plugin_name.'-jquery-widget', get_site_url() . '/wp-includes/js/jquery/ui/widget.min.js', array(), $this->version, 'all' ); wp_enqueue_script( $this->plugin_name.'-jquery-mouse', get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js', array(), $this->version, 'all' ); wp_enqueue_script( $this->plugin_name.'-sortable', get_site_url() . '/wp-includes/js/jquery/ui/sortable.min.js', array(), $this->version, 'all' ); } } // wordpress menu public function ace_register_options_page(){ add_menu_page( 'User Registration', // page title 'User Registration', //menu title 'manage_options', //capability 'ace-user-registration', // menu slug array($this, 'ace_register_page'), // callback function 'dashicons-dashboard', // icon 52 //position ); add_submenu_page( 'ace-user-registration', 'Custom Fields', 'Custom Fields', 'manage_options', 'ace-custom-field', array( $this, 'ace_add_fields_' ) ); add_submenu_page( 'ace-user-registration', // parent slug 'Settings', // page title 'Settings', // menu title 'manage_options', // capability 'Ace-Setting', //menu slug array($this, 'add_all_setting_plugin') // callback function ); } public function add_all_setting_plugin(){ global $wpdb; $recaptcha_keys = get_option('custom_reCapatcha_value'); if( isset( $_POST['save_reCaptcha'] ) ){ $secretkey = sanitize_text_field( $_POST['secretKEY'] ); $sitekey = sanitize_text_field( $_POST['siteKEY'] ); $success = ''; if( !empty( $secretkey )){ if( strlen( $secretkey ) == 40 ){ if( !empty($sitekey) ) { if( strlen( $sitekey ) == 40){ if( !empty( $_POST['reCapatchacheck'] ) == 1 ){ $checked = 1; }else{ $checked = 0; } $update_reCap = update_option( 'custom_reCapatcha_value', array( 'c_reCaptcha_value' => $checked, 'author_reCap_secertkey' => $secretkey, 'author_siteKey' => $sitekey ) ); }else{ $error['sitekey_vald'] = '! Site key field is empty'; } }else{ $error['sitekey_vald'] = '! Site key field is empty'; } }else{ $error['secretkey_vald'] = '! Secret key not valid'; } }else{ $error['empty_secert_key'] = '! Secret key field is empty'; } if( isset( $error ) ){ foreach ($error as $error_key => $error_value) { ?>       Seccussfully update    Seccussfully update'; } } $get_custom_css = ''; $get_custom_css = get_option( 'ace_custom_css_plugin', TRUE ); ?>
prefix.'ace_register_fields'; print "Included from $file
| input_type == 'text'){ ?> input_type == 'textarea') { ?> input_type == 'dropdown') { ?> |