File manager - Edit - /home/buyherba/public_html/wp-content/plugins/bing-webmaster-tools/includes/class-bing-url-submission.php
Back
<?php /** * The core plugin class. * * This is used to define admin-specific hooks. * * Also maintains the unique identifier of this plugin as well as the current * version of the plugin. * * @since 1.0.0 * @package Bing_Webmaster * @subpackage Bing_Webmaster/includes * @author Bing Webmaster <bingwpus@microsoft.com> */ class Bing_Webmaster { /** * The loader that's responsible for maintaining and registering all hooks that power * the plugin. * * @since 0.01.01 * @access protected * @var Bing_Webmaster_Loader $loader Maintains and registers all hooks for the plugin. */ protected $loader; /** * The unique identifier of this plugin. * * @since 0.01.01 * @access protected * @var string $plugin_name The string used to uniquely identify this plugin. */ protected $plugin_name; /** * The current version of the plugin. * * @since 0.01.01 * @access protected * @var string $version The current version of the plugin. */ protected $version; /** * Define the core functionality of the plugin. * * Set the plugin name and the plugin version that can be used throughout the plugin. * Load the dependencies and set the hooks for the admin area. * * @since 0.01.01 */ public function __construct($plugin_name) { if ( defined( 'BWT_URL_SUBMISSION_PLUGIN_VERSION' ) ) { $this->version = BWT_URL_SUBMISSION_PLUGIN_VERSION; } else { $this->version = '1.0.13'; } $this->plugin_name = $plugin_name; $this->load_dependencies(); $this->define_admin_hooks(); } /** * Load the required dependencies for this plugin. * * Include the following files that make up the plugin: * * - Bing_Webmaster_Loader. Orchestrates the hooks of the plugin. * - Bing_Webmaster_Admin. Defines all hooks for the admin area. * * Create an instance of the loader which will be used to register the hooks * with WordPress. * * @since 0.01.01 * @access private */ private function load_dependencies() { /** * The class responsible for orchestrating the actions and filters of the * core plugin. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-bing-url-submission-loader.php'; /** * The class responsible for defining all actions that occur in the admin area. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-bing-url-submission-admin.php'; $this->loader = new Bing_Webmaster_Loader(); } /** * Register all of the hooks related to the admin area functionality * of the plugin. * * @since 0.01.01 * @access private */ private function define_admin_hooks() { $plugin_admin = new Bing_Webmaster_Admin( $this->get_plugin_name(), $this->get_version() ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); // Save/Update our plugin options. $this->loader->add_action( 'admin_init', $plugin_admin, 'options_update'); $this->loader->add_action( 'rest_api_init', $plugin_admin, 'register_routes'); // Add a new admin menu. $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' ); // Add Settings link to the plugin. $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ); $this->loader->add_filter( 'plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links' ); // Add url submit action & post publishing. $this->loader->add_action( 'transition_post_status', $plugin_admin, 'on_post_published', 10, 3 ); } /** * Run the loader to execute all of the hooks with WordPress. * * @since 0.01.01 */ public function run() { $this->loader->run(); } /** * The name of the plugin used to uniquely identify it within the context of * WordPress and to define internationalization functionality. * * @since 1.0.0 * @return string The name of the plugin. */ public function get_plugin_name() { return $this->plugin_name; } /** * The reference to the class that orchestrates the hooks with the plugin. * * @since 1.0.0 * @return Bing_Webmaster_Loader Orchestrates the hooks of the plugin. */ public function get_loader() { return $this->loader; } /** * Retrieve the version number of the plugin. * * @since 1.0.0 * @return string The version number of the plugin. */ public function get_version() { return $this->version; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.13 |
proxy
|
phpinfo
|
Settings