0 && strlen($userId) > 0) { $output = ""; echo $output; } } /** * Creates a new settings for Ad Blocking Metrics class * @ABMSettings * @constructor __construct adds 2 actions admin_menu and admin_init * @function add_plugin_page Adds options page to wordpress admin plugins page * @function create_admin_page Creates admin settings page */ class ABMSettings { /** * Holds the values to be used in the fields callbacks */ private $options; /** * Start up */ public function __construct() { add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); add_action( 'admin_init', array( $this, 'page_init' ) ); } /** * Add options page */ public function add_plugin_page() { // This page will be under "Settings" add_options_page( 'Settings Admin', $GLOBALS["ABM_MAIN_TITLE"], 'manage_options', 'mz-abm-setting-admin', array( $this, 'create_admin_page' ) ); } /** * Options page callback */ public function create_admin_page() { // Set class property $this->options = get_option( 'ad_blocking_metrics_options' ); ?>

Ad Blocking Metrics

} /** * Get the settings option array and print one of its values */ public function service_callback() { $options = get_option('ad_blocking_metrics_options'); echo "'; } /** * Get the settings option array and print one of its values */ public function userId_callback() { printf( '', isset( $this->options['userId'] ) ? esc_attr( $this->options['userId']) : '' ); } /** * This function returns the content of a data element stored by the plugin * @param element element name to be fetched */ public function DataToget($element) { $data_element=get_option( $this->options[$element] ); return $data_element; } } // only admin can see this if( is_admin() ) $my_settings_page = new ABMSettings();