diff --git src/wp-admin/includes/class-wp-automatic-updater.php src/wp-admin/includes/class-wp-automatic-updater.php
index ea2d70c..bd3a6b6 100644
|
|
class WP_Automatic_Updater { |
31 | 31 | */ |
32 | 32 | public function is_disabled() { |
33 | 33 | // Background updates are disabled if you don't want file changes. |
34 | | if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) |
| 34 | if ( wp_disallow_file_mods() ) { |
35 | 35 | return true; |
| 36 | } |
36 | 37 | |
37 | 38 | if ( wp_installing() ) |
38 | 39 | return true; |
diff --git src/wp-admin/includes/dashboard.php src/wp-admin/includes/dashboard.php
index f3d2f79..18bb565 100644
|
|
function wp_dashboard_primary() { |
1149 | 1149 | ) |
1150 | 1150 | ); |
1151 | 1151 | |
1152 | | if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) { |
| 1152 | if ( ! wp_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' ) ) ) { |
1153 | 1153 | $feeds['plugins'] = array( |
1154 | 1154 | 'link' => '', |
1155 | 1155 | 'url' => array( |
diff --git src/wp-admin/includes/translation-install.php src/wp-admin/includes/translation-install.php
index ee8254d..91f641d 100644
|
|
function wp_download_language_pack( $download ) { |
181 | 181 | return $download; |
182 | 182 | } |
183 | 183 | |
184 | | if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) { |
| 184 | if ( wp_disallow_file_mods() ) { |
185 | 185 | return false; |
186 | 186 | } |
187 | 187 | |
… |
… |
function wp_download_language_pack( $download ) { |
224 | 224 | * @return bool Returns true on success, false on failure. |
225 | 225 | */ |
226 | 226 | function wp_can_install_language_pack() { |
227 | | if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) { |
| 227 | if ( wp_disallow_file_mods() ) { |
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | |
diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
index 6b04963..fb33765 100644
|
|
function upgrade_all() { |
559 | 559 | if ( $wp_current_db_version < 37965 ) |
560 | 560 | upgrade_460(); |
561 | 561 | |
| 562 | if ( $wp_current_db_version < 38613 ) |
| 563 | upgrade_470(); |
| 564 | |
562 | 565 | maybe_disable_link_manager(); |
563 | 566 | |
564 | 567 | maybe_disable_automattic_widgets(); |
… |
… |
function upgrade_460() { |
1727 | 1730 | } |
1728 | 1731 | |
1729 | 1732 | /** |
| 1733 | * Executes changes made in WordPress 4.7.0. |
| 1734 | * |
| 1735 | * @ignore |
| 1736 | * @since 4.6.0 |
| 1737 | * |
| 1738 | * @global int $wp_current_db_version Current database version. |
| 1739 | */ |
| 1740 | function upgrade_470() { |
| 1741 | global $wp_current_db_version; |
| 1742 | |
| 1743 | // Remove unused post meta. |
| 1744 | if ( $wp_current_db_version < 38613 ) { |
| 1745 | delete_transient( $cache_key = 'dash_' . md5( 'dashboard_primary_' . get_locale() ) ); |
| 1746 | } |
| 1747 | } |
| 1748 | |
| 1749 | /** |
1730 | 1750 | * Executes network-level upgrade routines. |
1731 | 1751 | * |
1732 | 1752 | * @since 3.0.0 |
diff --git src/wp-includes/capabilities.php src/wp-includes/capabilities.php
index da54229..51e9ab1 100644
|
|
function map_meta_cap( $cap, $user_id ) { |
333 | 333 | case 'edit_plugins': |
334 | 334 | case 'edit_themes': |
335 | 335 | // Disallow the file editors. |
336 | | if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) |
| 336 | if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) { |
337 | 337 | $caps[] = 'do_not_allow'; |
338 | | elseif ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) |
| 338 | } elseif ( wp_disallow_file_mods() ) { |
339 | 339 | $caps[] = 'do_not_allow'; |
340 | | elseif ( is_multisite() && ! is_super_admin( $user_id ) ) |
| 340 | } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { |
341 | 341 | $caps[] = 'do_not_allow'; |
342 | | else |
| 342 | } else { |
343 | 343 | $caps[] = $cap; |
| 344 | } |
344 | 345 | break; |
345 | 346 | case 'update_plugins': |
346 | 347 | case 'delete_plugins': |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
353 | 354 | case 'update_core': |
354 | 355 | // Disallow anything that creates, deletes, or updates core, plugin, or theme files. |
355 | 356 | // Files in uploads are excepted. |
356 | | if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) { |
| 357 | if ( wp_disallow_file_mods() ) { |
357 | 358 | $caps[] = 'do_not_allow'; |
358 | 359 | } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { |
359 | 360 | $caps[] = 'do_not_allow'; |
diff --git src/wp-includes/load.php src/wp-includes/load.php
index fbed09c..cb69256 100644
|
|
function wp_doing_ajax() { |
1056 | 1056 | } |
1057 | 1057 | |
1058 | 1058 | /** |
| 1059 | * Determines whether file modifications are disallowed. |
| 1060 | * |
| 1061 | * @since 4.7.0 |
| 1062 | * |
| 1063 | * @return bool True if file modifications are disallowed, false otherwise. |
| 1064 | */ |
| 1065 | function wp_disallow_file_mods() { |
| 1066 | return defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS; |
| 1067 | } |
| 1068 | |
| 1069 | /** |
1059 | 1070 | * Check whether variable is a WordPress Error. |
1060 | 1071 | * |
1061 | 1072 | * Returns true if $thing is an object of the WP_Error class. |
diff --git src/wp-includes/version.php src/wp-includes/version.php
index c616729..4b44e08 100644
|
|
$wp_version = '4.7-alpha-38178-src'; |
11 | 11 | * |
12 | 12 | * @global int $wp_db_version |
13 | 13 | */ |
14 | | $wp_db_version = 38590; |
| 14 | $wp_db_version = 38613; |
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Holds the TinyMCE version |