*/ class AdstxtManager_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; private $options; /** * 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; $this->options = array(); } public function display_notice() { //Make check to internal that this publisher has the domain integrated with ezoic n shit. global $hook_suffix; if ( in_array( $hook_suffix, array( 'plugins.php' ) ) ) { $has_issue = false; $issue_types = array(); if( !get_option('permalink_structure') ) { $issue_types['type'] = 'permalinks_disabled'; $has_issue = true; } $adstxtmanager_id = get_option('adstxtmanager_id'); if( !is_int($adstxtmanager_id["adstxtmanager_id"]) ) { if( $has_issue ) { $issue_types['type'] = $issue_types['type'] . "+" . "no_id"; } else { $issue_types['type'] = 'no_id'; $has_issue = true; } } if( $has_issue ) { $args = apply_filters( 'adstxtmanager_view_arguments', $issue_types, 'adstxtmanager-admin' ); foreach ( $args AS $key => $val ) { $$key = $val; } $file = ADSTXT_MANAGER__PLUGIN_DIR . 'admin/partials/'. 'adstxtmanager-admin-display' . '.php'; include( $file ); } } } /** * 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 AdstxtManager_Loader as all of the hooks are defined * in that particular class. * * The AdstxtManager_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/adstxtmanager-admin.css', array(), $this->version, 'all' ); } /** * Add options page */ public function add_plugin_page() { // This page will be under "Settings" add_options_page( 'Settings Admin', 'Ads.txt Manager Settings', 'manage_options', 'adstxtmanager-setting-admin', array( $this, 'create_admin_page' ) ); } /** * Options page callback */ public function create_admin_page() { // Set class property $this->options = get_option( 'adstxtmanager_id' ); ?>

Ads.txt Manager Settings

', isset( $this->options['adstxtmanager_id'] ) ? esc_attr( $this->options['adstxtmanager_id']) : '' ); } }