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

返回介绍

is_network_only_plugin()

发布于 2017-09-11 字数1777 浏览 968 评论 0

is_network_only_plugin( string $plugin )

Checks for “Network: true” in the plugin header to see if this should be activated only as a network wide plugin. The plugin would also work when Multisite is not enabled.


描述

Checks for "Site Wide Only: true" for backward compatibility.


参数

$plugin

(string)
(Required)
Path to the main plugin file from plugins directory.


返回值

(bool) True if plugin is network only, false otherwise.


源代码

File: wp-admin/includes/plugin.php

function is_network_only_plugin( $plugin ) {
	$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
	if ( $plugin_data )
		return $plugin_data['Network'];
	return false;
}

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Uses

  • wp-admin/includes/plugin.php:
    get_plugin_data()

Used By

  • wp-admin/includes/class-wp-plugins-list-table.php:
    WP_Plugins_List_Table::single_row()
  • wp-admin/includes/class-wp-plugins-list-table.php:
    WP_Plugins_List_Table::prepare_items()
  • wp-admin/includes/plugin.php:
    activate_plugin()
  • wp-admin/includes/ms-deprecated.php:
    is_wpmu_sitewide_plugin()

User Contributed Notes

上一篇:is_network_admin()

下一篇:is_new_day()

发布评论

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

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