Add $args and $user_id to 'um_after_profile_header_name'

Enhanced the action hook 'um_after_profile_header_name' by including `$args` and `$user_id` parameters. Updated documentation and examples to reflect these changes, enabling more flexible and detailed customization options for developers.
This commit is contained in:
Mykyta Synelnikov
2025-12-02 10:27:13 +02:00
parent ff14c0a773
commit 3d5d27c588
3 changed files with 16 additions and 14 deletions
+1
View File
@@ -6,6 +6,7 @@
- Added: Extra condition for checking the license activation requests.
- Added: 2nd `$args` attribute to the action hook 'um_cover_area_content'.
- Added: `$args` and `$user_id` attributes to the action hook 'um_after_profile_header_name'.
- Added: Class `um-profile-subnav-{$subnav_id}-link` to the sub navigation links in the User Profile page.
- Tweak: Updated `Extensions_Updater` class to use Action Scheduler in the upgrade process of the UM extensions.
+14 -14
View File
@@ -1230,24 +1230,24 @@ function um_profile_header( $args ) {
*/
do_action( 'um_after_profile_header_name_args', $args, um_user( 'ID' ) );
/**
* UM hook
* Fires after profile name in the header of the User Profile.
*
* @type action
* @title um_after_profile_name_inline
* @description Insert after profile name some content
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_after_profile_name_inline', 'function_name', 10 );
* @example
* <?php
* add_action( 'um_after_profile_name_inline', 'my_after_profile_name_inline', 10 );
* function my_after_profile_name_inline() {
* @hook um_after_profile_header_name
*
* @since 1.3.x
* @since 2.11.0 Added $args and $user_id attributes.
*
* @param {array} $args User Profile data.
* @param {int} $user_id User Profile ID.
*
* @example <caption>Display any custom content after profile name in the header of the User Profile.</caption>
* function my_after_profile_header_name( $args, $user_id ) {
* // your code here
* }
* ?>
* add_action( 'um_after_profile_header_name', 'my_after_profile_header_name', 10, 2 );
*/
do_action( 'um_after_profile_header_name' ); ?>
do_action( 'um_after_profile_header_name', $args, um_user( 'ID' ) );
?>
</div>
<?php if ( ! empty( $args['metafields'] ) ) { ?>
+1
View File
@@ -173,6 +173,7 @@ IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSI
* Added: Extra condition for checking the license activation requests.
* Added: 2nd `$args` attribute to the action hook 'um_cover_area_content'.
* Added: `$args` and `$user_id` attributes to the action hook 'um_after_profile_header_name'.
* Added: Class `um-profile-subnav-{$subnav_id}-link` to the sub navigation links in the User Profile page.
* Tweak: Updated `Extensions_Updater` class to use Action Scheduler in the upgrade process of the UM extensions.