当前位置: 首页>>代码示例>>PHP>>正文


PHP WPSEO_Utils::is_yoast_seo_page方法代码示例

本文整理汇总了PHP中WPSEO_Utils::is_yoast_seo_page方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSEO_Utils::is_yoast_seo_page方法的具体用法?PHP WPSEO_Utils::is_yoast_seo_page怎么用?PHP WPSEO_Utils::is_yoast_seo_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WPSEO_Utils的用法示例。


在下文中一共展示了WPSEO_Utils::is_yoast_seo_page方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * Run init logic.
  */
 public function init()
 {
     // Setting the screen option.
     if (filter_input(INPUT_GET, 'page') === 'wpseo_search_console') {
         if (filter_input(INPUT_GET, 'tab') !== 'settings' && WPSEO_GSC_Settings::get_profile() === '') {
             wp_redirect(add_query_arg('tab', 'settings'));
             exit;
         }
         $this->set_hooks();
         $this->set_dependencies();
         $this->request_handler();
     } elseif (WPSEO_Utils::is_yoast_seo_page() && current_user_can('manage_options') && WPSEO_GSC_Settings::get_profile() === '' && get_user_option('wpseo_dismissed_gsc_notice', get_current_user_id()) !== '1') {
         add_action('admin_init', array($this, 'register_gsc_notification'));
     }
     add_action('admin_init', array($this, 'register_settings'));
 }
开发者ID:healthcommcore,项目名称:osnap,代码行数:19,代码来源:class-gsc.php

示例2: __construct

 /**
  * Class constructor
  */
 function __construct()
 {
     global $pagenow;
     $this->options = WPSEO_Options::get_options(array('wpseo', 'wpseo_permalinks'));
     if (is_multisite()) {
         WPSEO_Options::maybe_set_multisite_defaults(false);
     }
     if ($this->options['stripcategorybase'] === true) {
         add_action('created_category', array($this, 'schedule_rewrite_flush'));
         add_action('edited_category', array($this, 'schedule_rewrite_flush'));
         add_action('delete_category', array($this, 'schedule_rewrite_flush'));
     }
     $this->admin_features = array('google_search_console' => new WPSEO_GSC(), 'dashboard_widget' => new Yoast_Dashboard_Widget());
     if (WPSEO_Metabox::is_post_overview($pagenow) || WPSEO_Metabox::is_post_edit($pagenow)) {
         $this->admin_features['primary_category'] = new WPSEO_Primary_Term_Admin();
     }
     if (filter_input(INPUT_GET, 'page') === 'wpseo_tools' && filter_input(INPUT_GET, 'tool') === null) {
         new WPSEO_Recalculate_Scores();
     }
     // Needs the lower than default priority so other plugins can hook underneath it without issue.
     add_action('admin_menu', array($this, 'register_settings_page'), 5);
     add_action('network_admin_menu', array($this, 'register_network_settings_page'));
     add_filter('plugin_action_links_' . WPSEO_BASENAME, array($this, 'add_action_link'), 10, 2);
     add_action('admin_enqueue_scripts', array($this, 'config_page_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_global_style'));
     if ($this->options['cleanslugs'] === true) {
         add_filter('name_save_pre', array($this, 'remove_stopwords_from_slug'), 0);
     }
     add_filter('user_contactmethods', array($this, 'update_contactmethods'), 10, 1);
     add_action('after_switch_theme', array($this, 'switch_theme'));
     add_action('switch_theme', array($this, 'switch_theme'));
     add_filter('set-screen-option', array($this, 'save_bulk_edit_options'), 10, 3);
     add_action('admin_init', array('WPSEO_Plugin_Conflict', 'hook_check_for_plugin_conflicts'), 10, 1);
     add_action('admin_init', array($this, 'import_plugin_hooks'));
     add_filter('wpseo_submenu_pages', array($this, 'filter_settings_pages'));
     WPSEO_Sitemaps_Cache::register_clear_on_option_update('wpseo');
     if (WPSEO_Utils::is_yoast_seo_page()) {
         add_action('admin_enqueue_scripts', array($this, 'enqueue_assets'));
     }
     if (WPSEO_Utils::is_api_available()) {
         $configuration = new WPSEO_Configuration_Page();
         if (filter_input(INPUT_GET, 'page') === self::PAGE_IDENTIFIER) {
             $configuration->catch_configuration_request();
         }
     }
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:49,代码来源:class-admin.php

示例3: display_for_current_user

 /**
  * Check if the notification is relevant for the current user
  *
  * @return bool True if a user needs to see this Notification, False if not.
  */
 public function display_for_current_user()
 {
     // If the notification is for the current page only, always show.
     if (!$this->is_persistent()) {
         return true;
     }
     // If we are not on a WPSEO page and this is required.
     if (true === $this->options['wpseo_page_only'] && !WPSEO_Utils::is_yoast_seo_page()) {
         return false;
     }
     // If the current user doesn't match capabilities.
     return $this->match_capabilities();
 }
开发者ID:designomx,项目名称:DMXFrmwrk,代码行数:18,代码来源:class-yoast-notification.php


注:本文中的WPSEO_Utils::is_yoast_seo_page方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。