diff options
Diffstat (limited to 'plugins/jetpack/modules/masterbar/profile-edit/bootstrap.php')
-rw-r--r-- | plugins/jetpack/modules/masterbar/profile-edit/bootstrap.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/masterbar/profile-edit/bootstrap.php b/plugins/jetpack/modules/masterbar/profile-edit/bootstrap.php new file mode 100644 index 00000000..acc7f336 --- /dev/null +++ b/plugins/jetpack/modules/masterbar/profile-edit/bootstrap.php @@ -0,0 +1,23 @@ +<?php +/** + * Bootstrap the WP.com User profile edit restriction. + * + * @package automattic\jetpack + */ + +namespace Automattic\Jetpack\Dashboard_Customizations; + +use Automattic\Jetpack\Connection\Manager as Connection_Manager; + +require_once __DIR__ . '/profile-edit.php'; +require_once __DIR__ . '/class-wpcom-user-profile-fields-revert.php'; + +/** + * Prevent WP.com user profile fields (first_name, last_name, display_name, description) to be updated. + */ +function load_the_user_profile_info_revert() { + new WPCOM_User_Profile_Fields_Revert( new Connection_Manager( 'jetpack' ) ); +} + +\add_action( 'load-profile.php', __NAMESPACE__ . '\load_the_user_profile_info_revert' ); +\add_action( 'load-user-edit.php', __NAMESPACE__ . '\load_the_user_profile_info_revert' ); |