userprofiles_account_sections

Filter Hook UserProfiles

Allows adding and removing sections from the UserProfiles account page.

Parameters

$sections

(array) sections array with title, summary and body keys for each section.

$params

(array) associative array with current profile user and public profile listing data

You need to have a working knowledge of Hooks before you get started.

Boilerplate Code

Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.

Clickfwd\Hook\Filter::add('userprofiles_account_sections', function($sections, $params) 
{
  // Uncomment line below to view available data passed into hook
  // For JReviews 3.x and earlier use dd instead of fwd_dd
  // fwd_dd($sections, $params);
  
  return $sections;
});
Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Examples

Add Section with Membership Information for 3rd Party Solution

If you have a membership solution from another provider on your site, you can add information about the user's membership status or link to the membership management page.

Clickfwd\Hook\Filter::add('userprofiles_account_sections', function($sections, $params = [])
{
  	// The user ID for the current profile

  	$userId = array_get($params,'user.User.id');
 
    $sections['membership'] = [
        'title'=>'Your Membership Status',
        'summary'=>'Below you can find the details of your current membership plan',
        'body'=>'<p>Here you can add a link to the membership page or if you have the code to lookup membership info you can insert the rendered template with that information here</p>'
    ];
 
  return $sections;
}, 10);

Source

  • /userprofiles/controllers/components/userprofiles_profile.php