• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpseo_add_capabilities函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpseo_add_capabilities函数的典型用法代码示例。如果您正苦于以下问题:PHP wpseo_add_capabilities函数的具体用法?PHP wpseo_add_capabilities怎么用?PHP wpseo_add_capabilities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: upgrade_15

 /**
  * Run the Yoast SEO 1.5 upgrade routine
  *
  * @param string $version Current plugin version.
  */
 private function upgrade_15($version)
 {
     // Clean up options and meta.
     WPSEO_Options::clean_up(null, $version);
     WPSEO_Meta::clean_up();
     // Add new capabilities on upgrade.
     wpseo_add_capabilities();
 }
开发者ID:Didox,项目名称:beminfinito,代码行数:13,代码来源:class-upgrade.php


示例2: wpseo_activate

/**
 * Runs on activation of the plugin.
 */
function wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    WPSEO_Options::get_instance();
    WPSEO_Options::initialize();
    flush_rewrite_rules();
    wpseo_add_capabilities();
    WPSEO_Options::schedule_yoast_tracking(null, get_option('wpseo'));
    // Clear cache so the changes are obvious.
    WPSEO_Options::clear_cache();
    do_action('wpseo_activate');
}
开发者ID:Ingenex,项目名称:redesign,代码行数:15,代码来源:wp-seo-main.php


示例3: wpseo_do_upgrade

/**
 * Run the upgrade procedures.
 *
 * @todo - [JRF => Yoast] check: if upgrade is run on multi-site installation, upgrade for all sites ?
 * Maybe not necessary as it is now run on plugins_loaded, so upgrade will run as soon as any page
 * on a site is requested.
 */
function wpseo_do_upgrade() {
	$option_wpseo = get_option( 'wpseo' );

	if ( $option_wpseo['version'] === '' || version_compare( $option_wpseo['version'], '1.2', '<' ) ) {
		add_action( 'init', 'wpseo_title_test' );
	}

	if ( $option_wpseo['version'] === '' || version_compare( $option_wpseo['version'], '1.4.13', '<' ) ) {
		// Run description test once theme has loaded
		add_action( 'init', 'wpseo_description_test' );
	}

	if ( $option_wpseo['version'] === '' || version_compare( $option_wpseo['version'], '1.4.15', '<' ) ) {
		add_action( 'shutdown', 'flush_rewrite_rules' );
	}

	if ( version_compare( $option_wpseo['version'], '1.5.0', '<' ) ) {

		// Clean up options and meta
		WPSEO_Options::clean_up( null, $option_wpseo['version'] );
		WPSEO_Meta::clean_up();

		// Add new capabilities on upgrade
		wpseo_add_capabilities();
	}

	/* Only correct the breadcrumb defaults for upgrades from v1.5+ to v1.5.2.3, upgrades from earlier version
	   will already get this functionality in the clean_up routine. */
	if ( version_compare( $option_wpseo['version'], '1.4.25', '>' ) && version_compare( $option_wpseo['version'], '1.5.2.3', '<' ) ) {
		add_action( 'init', array( 'WPSEO_Options', 'bring_back_breadcrumb_defaults' ), 3 );
	}

	if ( version_compare( $option_wpseo['version'], '1.4.25', '>' ) && version_compare( $option_wpseo['version'], '1.5.2.4', '<' ) ) {
		/* Make sure empty maintax/mainpt strings will convert to 0 */
		WPSEO_Options::clean_up( 'wpseo_internallinks', $option_wpseo['version'] );

		/* Remove slashes from taxonomy meta texts */
		WPSEO_Options::clean_up( 'wpseo_taxonomy_meta', $option_wpseo['version'] );
	}

	// Make sure version nr gets updated for any version without specific upgrades
	$option_wpseo = get_option( 'wpseo' ); // re-get to make sure we have the latest version
	if ( version_compare( $option_wpseo['version'], WPSEO_VERSION, '<' ) ) {
		update_option( 'wpseo', $option_wpseo );
	}
}
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:53,代码来源:wpseo-functions.php


示例4: wpseo_do_upgrade

/**
 * Run the upgrade procedures.
 *
 * @todo - [JRF => Yoast] check: if upgrade is run on multi-site installation, upgrade for all sites ?
 * Maybe not necessary as it is now run on plugins_loaded, so upgrade will run as soon as any page
 * on a site is requested.
 */
function wpseo_do_upgrade()
{
    /* Make sure title_test and description_test functions are available */
    require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
    $option_wpseo = get_option('wpseo');
    WPSEO_Options::maybe_set_multisite_defaults(false);
    //	if ( $option_wpseo['version'] === '' || version_compare( $option_wpseo['version'], '1.2', '<' ) ) {
    //		add_action( 'init', 'wpseo_title_test' );
    //	}
    if ($option_wpseo['version'] === '' || version_compare($option_wpseo['version'], '1.4.13', '<')) {
        // Run description test once theme has loaded
        add_action('init', 'wpseo_description_test');
    }
    if ($option_wpseo['version'] === '' || version_compare($option_wpseo['version'], '1.4.15', '<')) {
        add_action('shutdown', 'flush_rewrite_rules');
    }
    if (version_compare($option_wpseo['version'], '1.5.0', '<')) {
        // Clean up options and meta
        WPSEO_Options::clean_up(null, $option_wpseo['version']);
        WPSEO_Meta::clean_up();
        // Add new capabilities on upgrade
        wpseo_add_capabilities();
    }
    /* Only correct the breadcrumb defaults for upgrades from v1.5+ to v1.5.2.3, upgrades from earlier version
       will already get this functionality in the clean_up routine. */
    if (version_compare($option_wpseo['version'], '1.4.25', '>') && version_compare($option_wpseo['version'], '1.5.2.3', '<')) {
        add_action('init', array('WPSEO_Options', 'bring_back_breadcrumb_defaults'), 3);
    }
    if (version_compare($option_wpseo['version'], '1.4.25', '>') && version_compare($option_wpseo['version'], '1.5.2.4', '<')) {
        /* Make sure empty maintax/mainpt strings will convert to 0 */
        WPSEO_Options::clean_up('wpseo_internallinks', $option_wpseo['version']);
        /* Remove slashes from taxonomy meta texts */
        WPSEO_Options::clean_up('wpseo_taxonomy_meta', $option_wpseo['version']);
    }
    /* Clean up stray wpseo_ms options from the options table, option should only exist in the sitemeta table */
    delete_option('wpseo_ms');
    // Make sure version nr gets updated for any version without specific upgrades
    $option_wpseo = get_option('wpseo');
    // re-get to make sure we have the latest version
    if (version_compare($option_wpseo['version'], WPSEO_VERSION, '<')) {
        update_option('wpseo', $option_wpseo);
    }
    // Make sure all our options always exist - issue #1245
    WPSEO_Options::ensure_options_exist();
}
开发者ID:CrankMaster336,项目名称:FFW-TR,代码行数:52,代码来源:wpseo-functions.php


示例5: _wpseo_activate

/**
 * Runs on activation of the plugin.
 */
function _wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    wpseo_load_textdomain();
    // Make sure we have our translations available for the defaults.
    WPSEO_Options::get_instance();
    if (!is_multisite()) {
        WPSEO_Options::initialize();
    } else {
        WPSEO_Options::maybe_set_multisite_defaults(true);
    }
    WPSEO_Options::ensure_options_exist();
    if (is_multisite() && ms_is_switched()) {
        delete_option('rewrite_rules');
    } else {
        add_action('shutdown', 'flush_rewrite_rules');
    }
    wpseo_add_capabilities();
    // Clear cache so the changes are obvious.
    WPSEO_Utils::clear_cache();
    do_action('wpseo_activate');
}
开发者ID:misfist,项目名称:missdrepants-network,代码行数:25,代码来源:wp-seo-main.php


示例6: _wpseo_activate

/**
 * Runs on activation of the plugin.
 */
function _wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    wpseo_load_textdomain();
    // Make sure we have our translations available for the defaults
    WPSEO_Options::get_instance();
    if (!is_multisite()) {
        WPSEO_Options::initialize();
    } else {
        WPSEO_Options::maybe_set_multisite_defaults(true);
    }
    WPSEO_Options::ensure_options_exist();
    flush_rewrite_rules();
    wpseo_add_capabilities();
    WPSEO_Options::schedule_yoast_tracking(null, get_option('wpseo'));
    // Clear cache so the changes are obvious.
    WPSEO_Options::clear_cache();
    do_action('wpseo_activate');
}
开发者ID:UPMediaDesign,项目名称:vidaestudiantilip,代码行数:22,代码来源:wp-seo-main.php


示例7: wpseo_do_upgrade

/**
 * Run the upgrade procedures.
 *
 * @todo - [JRF => Yoast] check: if upgrade is run on multi-site installation, upgrade for all sites ?
 * Maybe not necessary as it is now run on plugins_loaded, so upgrade will run as soon as any page
 * on a site is requested.
 */
function wpseo_do_upgrade()
{
    /* Make sure title_test and description_test functions are available */
    require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
    $option_wpseo = get_option('wpseo');
    WPSEO_Options::maybe_set_multisite_defaults(false);
    // Just flush rewrites, always, to at least make them work after an upgrade.
    add_action('shutdown', 'flush_rewrite_rules');
    WPSEO_Utils::clear_sitemap_cache();
    if (version_compare($option_wpseo['version'], '1.8.0', '<')) {
        $options_titles = get_option('wpseo_titles');
        $options_permalinks = get_option('wpseo_permalinks');
        foreach (array('hide-feedlinks', 'hide-rsdlink', 'hide-shortlink', 'hide-wlwmanifest') as $hide) {
            if (isset($options_titles[$hide])) {
                $options_permalinks[$hide] = $options_titles[$hide];
                unset($options_titles[$hide]);
                update_option('wpseo_permalinks', $options_permalinks);
                update_option('wpseo_titles', $options_titles);
            }
        }
        unset($options_titles, $options_permalinks);
        $options_social = get_option('wpseo_social');
        if (isset($option_wpseo['pinterestverify'])) {
            $options_social['pinterestverify'] = $option_wpseo['pinterestverify'];
            unset($option_wpseo['pinterestverify']);
            update_option('wpseo_social', $options_social);
            update_option('wpseo', $option_wpseo);
        }
        unset($options_social);
    }
    if ($option_wpseo['version'] === '' || version_compare($option_wpseo['version'], '1.4.13', '<')) {
        // Run description test once theme has loaded
        add_action('init', 'wpseo_description_test');
    }
    if (version_compare($option_wpseo['version'], '1.5.0', '<')) {
        // Clean up options and meta
        WPSEO_Options::clean_up(null, $option_wpseo['version']);
        WPSEO_Meta::clean_up();
        // Add new capabilities on upgrade
        wpseo_add_capabilities();
    }
    /* Only correct the breadcrumb defaults for upgrades from v1.5+ to v1.5.2.3, upgrades from earlier version
       will already get this functionality in the clean_up routine. */
    if (version_compare($option_wpseo['version'], '1.4.25', '>') && version_compare($option_wpseo['version'], '1.5.2.3', '<')) {
        add_action('init', array('WPSEO_Options', 'bring_back_breadcrumb_defaults'), 3);
    }
    if (version_compare($option_wpseo['version'], '1.4.25', '>') && version_compare($option_wpseo['version'], '1.5.2.4', '<')) {
        /* Make sure empty maintax/mainpt strings will convert to 0 */
        WPSEO_Options::clean_up('wpseo_internallinks', $option_wpseo['version']);
        /* Remove slashes from taxonomy meta texts */
        WPSEO_Options::clean_up('wpseo_taxonomy_meta', $option_wpseo['version']);
    }
    /* Clean up stray wpseo_ms options from the options table, option should only exist in the sitemeta table */
    delete_option('wpseo_ms');
    // Make sure version nr gets updated for any version without specific upgrades
    $option_wpseo = get_option('wpseo');
    // re-get to make sure we have the latest version
    if (version_compare($option_wpseo['version'], WPSEO_VERSION, '<')) {
        update_option('wpseo', $option_wpseo);
    }
    // Make sure all our options always exist - issue #1245
    WPSEO_Options::ensure_options_exist();
    add_action('admin_footer', 'wpseo_redirect_to_about');
}
开发者ID:BennyHudson,项目名称:ben-hudson,代码行数:71,代码来源:wpseo-functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpseo_description_test函数代码示例发布时间:2022-05-23
下一篇:
PHP wpsc_vargrp_id函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap