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

返回介绍

is_uninstallable_plugin()

发布于 2017-09-11 字数1405 浏览 937 评论 0

is_uninstallable_plugin( string $plugin )

Whether the plugin can be uninstalled.


描述


参数

$plugin

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


返回值

(bool) Whether plugin can be uninstalled.


源代码

File: wp-admin/includes/plugin.php

function is_uninstallable_plugin($plugin) {
	$file = plugin_basename($plugin);

	$uninstallable_plugins = (array) get_option('uninstall_plugins');
	if ( isset( $uninstallable_plugins[$file] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) )
		return true;

	return false;
}

更新日志

Version 描述
2.7.0 Introduced.

相关函数

Uses

  • wp-includes/plugin.php:
    plugin_basename()
  • wp-includes/option.php:
    get_option()

Used By

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

User Contributed Notes

发布评论

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

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