mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Upgrade/Install: Introduce wp_disallow_file_mods() helper function.
This is a wrapper around the checks for the `DISALLOW_FILE_MODS` constant to determine whether file modifications are disallowed. Props MaximeCulea. Fixes #38673. git-svn-id: https://develop.svn.wordpress.org/trunk@40394 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -31,7 +31,7 @@ class WP_Automatic_Updater {
|
||||
*/
|
||||
public function is_disabled() {
|
||||
// Background updates are disabled if you don't want file changes.
|
||||
if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
|
||||
if ( wp_disallow_file_mods( 'automatic_updater' ) )
|
||||
return true;
|
||||
|
||||
if ( wp_installing() )
|
||||
|
||||
@@ -1152,7 +1152,7 @@ function wp_dashboard_primary() {
|
||||
)
|
||||
);
|
||||
|
||||
if ( ( ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS ) && ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
|
||||
if ( ( ! wp_disallow_file_mods( 'dashboard_widget' ) ) && ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
|
||||
$feeds['plugins'] = array(
|
||||
'link' => '',
|
||||
'url' => array(
|
||||
|
||||
@@ -202,7 +202,7 @@ function wp_download_language_pack( $download ) {
|
||||
return $download;
|
||||
}
|
||||
|
||||
if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
|
||||
if ( wp_disallow_file_mods( 'download_language_pack' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ function wp_download_language_pack( $download ) {
|
||||
* @return bool Returns true on success, false on failure.
|
||||
*/
|
||||
function wp_can_install_language_pack() {
|
||||
if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
|
||||
if ( wp_disallow_file_mods( 'can_install_language_pack' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user