maybe_disable_automattic_widgets() - WordPress 函数参考中文文档

返回介绍

maybe_disable_automattic_widgets()

发布于 2017-09-11 字数1028 浏览 923 评论 0

maybe_disable_automattic_widgets()

Disables the Automattic widgets plugin, which was merged into core.


描述


源代码

File: wp-admin/includes/upgrade.php

function maybe_disable_automattic_widgets() {
	$plugins = __get_option( 'active_plugins' );

	foreach ( (array) $plugins as $plugin ) {
		if ( basename( $plugin ) == 'widgets.php' ) {
			array_splice( $plugins, array_search( $plugin, $plugins ), 1 );
			update_option( 'active_plugins', $plugins );
			break;
		}
	}
}

更新日志

Version 描述
2.2.0 Introduced.

相关函数

Uses

  • wp-includes/option.php:
    update_option()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!