當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPSEO_Utils::is_api_available方法代碼示例

本文整理匯總了PHP中WPSEO_Utils::is_api_available方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPSEO_Utils::is_api_available方法的具體用法?PHP WPSEO_Utils::is_api_available怎麽用?PHP WPSEO_Utils::is_api_available使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WPSEO_Utils的用法示例。


在下文中一共展示了WPSEO_Utils::is_api_available方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Checks if Yoast SEO is installed for the first time.
  */
 public function __construct()
 {
     $is_first_install = $this->is_first_install();
     if ($is_first_install && WPSEO_Utils::is_api_available()) {
         add_action('wpseo_activate', array($this, 'set_first_install_options'));
     }
 }
開發者ID:jesusmarket,項目名稱:jesusmarket,代碼行數:10,代碼來源:class-wpseo-installation.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: header

<?php

/**
 * @package WPSEO\Admin\Views
 */
if (!defined('WPSEO_VERSION')) {
    header('Status: 403 Forbidden');
    header('HTTP/1.1 403 Forbidden');
    exit;
}
if (WPSEO_Utils::is_api_available()) {
    echo '<h2>' . esc_html__('Installation wizard', 'wordpress-seo') . '</h2>';
    ?>
	<p>
		<?php 
    /* translators: %1$s expands to Yoast SEO */
    printf(__('Configure %1$s step-by-step.', 'wordpress-seo'), 'Yoast SEO');
    ?>
	</p>
<p>
	<a class="button"
	   href="<?php 
    echo esc_url(admin_url('admin.php?page=' . WPSEO_Configuration_Page::PAGE_IDENTIFIER));
    ?>
"><?php 
    _e('Open the installation wizard', 'wordpress-seo');
    ?>
</a>
</p>

	<br/>
開發者ID:jesusmarket,項目名稱:jesusmarket,代碼行數:31,代碼來源:general.php

示例4: wpseo_init_rest_api

/**
 * Loads the rest api endpoints.
 */
function wpseo_init_rest_api()
{
    // We can't do anything when requirements are not met.
    if (WPSEO_Utils::is_api_available()) {
        // Boot up REST API endpoints.
        $configuration_service = new WPSEO_Configuration_Service();
        $configuration_service->set_default_providers();
        $configuration_service->register_hooks();
    }
}
開發者ID:developmentDM2,項目名稱:Whohaha,代碼行數:13,代碼來源:wp-seo-main.php


注:本文中的WPSEO_Utils::is_api_available方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。