added the WIP company head shortcut and a menu for editing company stuff, instead of the user profile.

This commit is contained in:
2026-03-12 22:05:37 +01:00
parent b6d0959cf6
commit ccfb737949
12 changed files with 222 additions and 94 deletions

View File

@@ -18,6 +18,7 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
}
private function activate_fields() {
$this->loader->add_action( 'load-profile.php', $this, 'remove_custom_user_fields' );
$this->loader->add_action( 'show_user_profile', $this, 'add_custom_user_fields' );
$this->loader->add_action( 'edit_user_profile', $this, 'add_custom_user_fields' );
$this->loader->add_action( 'personal_options_update', $this, 'save_custom_user_fields' );
@@ -26,8 +27,14 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
$this->loader->add_action( 'register_form', $this, 'registration_form' );
$this->loader->add_filter( 'registration_errors', $this, 'registration_errors', 10, 3 );
$this->loader->add_filter( 'comment_post', $this, 'validate_comment' );
}
public function remove_custom_user_fields() {
remove_all_actions('show_user_profile');
remove_all_actions('edit_user_profile');
}
public function add_custom_user_fields( $user ) {
$company = get_user_meta( $user->ID, 'company', true );
?>

View File

@@ -165,6 +165,8 @@ class Partnerexpo_Core {
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_menu' );
}
/**