WP Team Pro

  1. Home
  2. Docs
  3. WP Team Pro
  4. Hooks: Actions and Filters

Hooks: Actions and Filters

We have added the following hooks for developers to extend functionalities:

1) sp_team_pro_add_custom_css
2) sp_team_pro_before_section_title
3) sp_team_pro_after_section_title
4) sp_team_pro_before_member_description
5) sp_team_pro_after_member_description
6) sp_team_pro_before_member_email
7) sp_team_pro_after_member_email
8) sp_team_pro_before_member_job_title
9) sp_team_pro_after_member_job_title
10) sp_team_pro_before_member_location
11) sp_team_pro_after_member_location
12) sp_team_pro_before_member_mobile
13) sp_team_pro_after_member_mobile
14) sp_team_pro_before_member_name
15) sp_team_pro_after_member_name
16) sp_team_pro_before_member_phone
17) sp_team_pro_after_member_phone
18) sp_team_pro_before_member_skill
19) sp_team_pro_after_member_skill
20) sp_team_pro_before_member_social
21) sp_team_pro_after_member_social
22) sp_team_pro_before_member_website
23) sp_team_pro_after_member_website

 

How to Use the Filter Hooks:

1. sp_team_pro_dynamic_css

It allows you to modify the plugin Dynamic CSS as you need. The hook is located in wp-team-pro/src/Frontend/frontend.php (line no: 299)

function modified_sp_team_pro_dynamic_css( $value ) {
    return $value;
} 
                    /*hook*/                      /*function*/
add_filter( 'sp_team_pro_dynamic_css', 'modified_sp_team_pro_dynamic_css' );
2. team_pro_style_load_in_header

Using this hook you can control the plugin style load in the header.  The hook is located in wp-team-pro/src/Frontend/templates/section-title.php (line no: 10)

function modified_sp_team_pro_dynamic_css( $value ) {
    $value = false;
    return $value;
}
add_filter( 'team_pro_style_load_in_header', 'modified_team_pro_style_load_in_header' );

The above code will help to disable the loading style in the header. Instead, the style will load another section of the plugin.

3. sptp_member_job_title

This filter hook can be used to modify the member Job Title section. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 120)

function modified_job_title( $jobtitle ) {
    $jobtitle = '<h5 class="sptp_job_title">' . $jobtitle . '</h5>';
    return $jobtitle;
}
add_filter( 'sptp_member_job_title', 'modified_job_title' );
4. sptp_member_email

Use this hook to modified the member email section. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 153)

function modified_email( $mail ) {
    $email = '<div class="sptp_email">' . $mail . '</div>';
    return $mail;
}
add_filter( 'sptp_member_email', 'modified_mail' );

The above will wrap the whole email section inside a DIV.

5. sptp_member_phone

Use this hook to add/change to the member phone section of the WP Team plugin. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 185)

add_filter('sptp_member_phone', 'modified_sptp_member_phone');
 
function modified_sptp_member_phone($phone) {
     $phone= '<div class="sptp_phone">' . $phone. '</div>';
     return $phone;
}
6. sptp_member_location

Modify the Member location section with this filter hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 213)

add_filter( 'sptp_member_location', 'modified_sptp_member_location' );

function modified_sptp_member_location($location) {
    $location= '<h2 class="sptp_location">' . $location. '</h2>';
    return $location;
}
7. sptp_member_mobile

You can add/change the member mobile information using this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 244)

function modified_member_mobile( $mobile ) {
    return 'email:-' . $mobile . 'your text here';
}
 add_filter( 'sptp_member_mobile', 'modified_member_mobile' );
9. sptp_preloader

Modify the preloader section of the plugin using this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 297)

function modified_sptp_preloader( $preloader ) {
    $preloader = '<h2class="sptp_preloader">' . $preloader . '</h2>';
    return $preloader;
}
add_filter( 'sptp_preloader', 'modified_sptp_preloader' );

10. sptp_section-title

This hook helps you to edit the team section title. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 320)

add_filter( 'sptp_section-title', 'modified_section-title' );

function modified_section-title( $title ) {
    $title = '<h3 class="sptp_title">' . $title . '</h3>';
    return $title;
}
11. sptp_member_skill

It allows you to customize the member skill section. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 347)

add_filter( 'sptp_member_skill', 'modified_sptp_member_skill' );

function modified_sptp_member_skill( $member_skill ) {
    $member_skill = '<h2 class="sptp_member_skill">' . $member_skill . '</h2>';
    return $member_skill;
}
12. sptp_member_social

Customize the member’s social information using this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 376)

add_filter( 'sptp_member_social', 'modified_sptp_member_social' );

function modified_sptp_member_social( $member_social ) {
    $member_social = '<h2 class="sptp_member_social">' . $member_social . '</h2>';
    return $member_social;
}
13. sptp_member_content

Modify the team member content using this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 416)

add_filter( 'sptp_member_content', 'modified_sptp_member_content' );

function modified_sptp_member_content( $member_content ) {
    $member_content = '<h2 class="sptp_member_content">' . $member_content . '</h2>';
    return $member_content;
}
14. sptp_member_description

It allows you to modify the team member description section. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 421)

add_filter( 'sptp_member_description', 'modified_sptp_member_description' );

function modified_sptp_member_description( $member_description ) {
    $member_description = '<h2 class="sptp_member_description">' . $member_description . '</h2>';
    return $member_description;
}
15. sptp_member_name

The filter hook can be used to modify the member name section. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 444)

add_filter( 'sptp_member_name', 'modified_sptp_member_name' );

function modified_sptp_member_name( $member_name ) {
    $member_name = '<h2 class="sptp_member_name">' . $member_name . '</h2>';
    return $member_name;
}
16. sptp_member_image

This allows you to modify the member image section. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 539)

add_filter( 'sptp_member_image', 'modified_sptp_member_image' );

function modified_sptp_member_image( $member_image ) {
    $member_image = '<h2 class="sptp_member_image">' . $member_image . '</h2>';
    return $member_image;
}
17. sptp_member_image_overlay_icon

Modify the member image overlay icon using this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 539)

add_filter( 'sptp_member_image_overlay_icon', 'modified_sptp_member_image_overlay_icon' );

function modified_sptp_member_image_overlay_icon( $overlay_icon ) {
    $overlay_icon = '<h2 class="sptp_overlay_icon">' . $overlay_icon . '</h2>';
    return $overlay_icon;
}
18. sptp_member_placeholder_image_src

Modify the member placeholder image source using this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 817)

add_filter( 'sptp_member_placeholder_image_src', 'modified_sptp_member_placeholder_image_src' );

function modified_sptp_member_placeholder_image_src( $image_src ) {
    $image_src = '<h2 class="sptp_image_src">' . $image_src . '</h2>';
    return $image_src;
}
19. sptp_placeholder_image_width

Set the placeholder image width by this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 821)

add_filter( 'sptp_placeholder_image_width', 'modified_sptp_placeholder_image_width' );

function modified_sptp_placeholder_image_width( $image_width ) {
    $image_width = '<h2 class="sptp_image_width">' . $image_width . '</h2>';
    return $image_width;
}
20. sptp_placeholder_image_height

Set the placeholder image height by this hook. The hook is located in wp-team-pro/src/Frontend/helper.php (line no: 822)

add_filter( 'sptp_placeholder_image_height', 'modified_sptp_placeholder_image_height' );

function modified_sptp_placeholder_image_height( $image_height ) {
    $image_height = '<h2 class="sptp_image_height">' . $image_height . '</h2>';
    return $image_height;
}
21. sp_team_pro_member_email_icon

Customize the member email icon using this hook. The hook is located in wp-team-pro/src/Frontend/templates/member/email.php (line no: 16)

add_filter( 'sp_team_pro_member_email_icon', 'modified_sp_team_pro_member_email_icon' );

function modified_sp_team_pro_member_email_icon( $email_icon ) {
    $email_icon = '<h2 class="sptp_email_icon">' . $email_icon . '</h2>';
    return $email_icon;
}
22. sp_team_pro_member_location_icon

This hook helps you to modify the member location icon. The hook is located in wp-team-pro/src/Frontend/templates/member/location.php (line no: 15)

add_filter( 'sp_team_pro_member_location_icon', 'modified_sp_team_pro_member_location_icon' );

function modified_sp_team_pro_member_location_icon( $location_icon ) {
    $location_icon = '<h2 class="sptp_location_icon">' . $location_icon . '</h2>';
    return $location_icon;
}
23. sp_team_pro_member_mobile_icon

It allows you to customize the member mobile icon. The hook is located in wp-team-pro/src/Frontend/templates/member/mobile.php (line no: 15)

add_filter( 'sp_team_pro_member_mobile_icon', 'modified_sp_team_pro_member_mobile_icon' );

function modified_sp_team_pro_member_mobile_icon( $mobile_icon ) {
    $mobile_icon = '<h2 class="sptp_mobile_icon">' . $mobile_icon . '</h2>';
    return $mobile_icon;
}
24. sp_team_pro_member_phone_icon

Use this hook to customize the member phone icon. The hook is located in wp-team-pro/src/Frontend/templates/member/phone.php (line no: 15)

add_filter( 'sp_team_pro_member_phone_icon', 'modified_sp_team_pro_member_phone_icon' );

function modified_sp_team_pro_member_phone_icon( $phone_icon ) {
    $phone_icon = '<h2 class="sptp_phone_icon">' . $phone_icon . '</h2>';
    return $phone_icon;
}
25. sp_team_pro_member_website_icon

To customize the member website icon use this hook. The hook is located in wp-team-pro/src/Frontend/templates/member/website.php (line no: 15)

add_filter( 'sp_team_pro_member_website_icon', 'modified_sp_team_pro_member_website_icon' );

function modified_sp_team_pro_member_website_icon( $website_icon ) {
    $website_icon = '<h2 class="sptp_website_icon">' . $website_icon . '</h2>';
    return $website_icon;
}

 

How to Use the Action Hooks:

1. sp_team_pro_add_custom_css

This action hook allows you to add any custom  CSS style in the plugin dynamic-style.php. The hook is located in wp-team-pro/src/Frontend/partial/dynamic-style.php (line no: 690)

add_action('sp_team_pro_add_custom_css', 'custom_style');
 
function custom_style() {
    
    wp_enqueue_style('custom_css', get_template_directory_uri() . '/assets/css/costom.css', array(), '1.0.0', 'all');
}
2. sp_team_pro_before_section_title

Use this hook to add anything before the section title. The hook is located in wp-team-pro/src/Frontend/templates/section-title.php (line no: 10)

function changes_before_title() {
    echo 'do the changes here';
}
add_action('sp_team_pro_before_section_title', 'changes_before_title');
3. sp_team_pro_after_section_title

Use this hook to add anything after the section title. The hook is located in wp-team-pro/src/Frontend/templates/section-title.php (line no: 12)

add_action('sp_team_pro_after_section_title', 'changes_after_title');
 
function changes_after_title() {
    echo '<h2> Sub Title: </h2>';
}
4. sp_team_pro_before_member_description

With this hook, you can add anything before the member description.  The hook is located in wp-team-pro/src/Frontend/templates/member/description.php (line no: 10)

add_action('sp_team_pro_before_member_description', 'changes_before_description');
 
function changes_before_description() {
    echo '<h2> your customization here! </h2>';
}
5. sp_team_pro_after_member_description

With this hook, you can add anything after the member description.  The hook is located in wp-team-pro/src/Frontend/templates/member/description.php (line no: 12)

 function changes_after_description() {
    echo '<h2> do the customization here </h2>';
}
add_action('sp_team_pro_after_member_description', 'changes_after_description');
6. sp_team_pro_before_member_email

Do the customization before members email using this hook. The hook is located in wp-team-pro/src/Frontend/templates/member/email.php (line no: 14)

add_action('sp_team_pro_before_member_email', 'changes_before_email');
 
function changes_before_email() {
    echo '<div> Do the changes here </div>';
}
7. sp_team_pro_after_member_email

Do the customization after members email using this hook. The hook is located in wp-team-pro/src/Frontend/templates/member/email.php (line no: 22)

add_action('sp_team_pro_after_member_email', 'changes_after_email');
 
function changes_after_email() {
    echo '<div> Do the changes here </div>';
}
8. sp_team_pro_before_member_job_title

This allows you to add anything before a member’s job title. The hook is located in wp-team-pro/src/Frontend/templates/member/job-title.php (line no: 22)

add_action('sp_team_pro_before_member_job_title', 'changes_before_member_job_title');
 
function changes_before_member_job_title() {
    echo '<div> Do the changes here </div>';
}
9. sp_team_pro_after_member_job_title

This allows you to add anything after a member’s job title. The hook is located in wp-team-pro/src/Frontend/templates/member/job-title.php (line no: 24)

add_action('sp_team_pro_after_member_job_title', 'changes_after_member_job_title');
 
function changes_after_member_job_title() {
    echo '<div> Do the changes here </div>';
}
10. sp_team_pro_before_member_location

This will help you to display anything before the member location. The hook is located in wp-team-pro/src/Frontend/templates/member/location.php (line no: 12)

add_action('sp_team_pro_before_member_location', 'changes_before_member_location');
 
function changes_before_member_location() {
    echo '<div> Do the changes here </div>';
}
11. sp_team_pro_after_member_location

This will help you to display anything after the member location. The hook is located in wp-team-pro/src/Frontend/templates/member/location.php (line no: 19)

add_action('sp_team_pro_after_member_location', 'changes_after_member_location');
 
function changes_after_member_location() {
    echo '<div> Do the changes here </div>';
}
12. sp_team_pro_before_member_mobile

Use this hook to do any changes before the member mobile section. The hook is located in wp-team-pro/src/Frontend/templates/member/mobile.php (line no: 13)

add_action( 'sp_team_pro_before_member_mobile', 'changes_before_member_mobile' );
 
function changes_before_member_mobile() {
    echo '<h3> Do the changes here </h3>';
}
13. sp_team_pro_after_member_mobile

Use this hook to do any changes after the member mobile section. The hook is located in wp-team-pro/src/Frontend/templates/member/mobile.php (line no: 21)

add_action( 'sp_team_pro_after_member_mobile', 'changes_after_member_mobile' );
 
function changes_after_member_mobile() {
    echo '<h3> Do the changes here </h3>';
}
14. sp_team_pro_before_member_name

This hook allows you to add anything before the member name section. The hook is located in wp-team-pro/src/Frontend/templates/member/name.php (line no: 12)

add_action( 'sp_team_pro_before_member_name', 'changes_before_member_name' );
 
function changes_before_member_name() {
    echo '<h4> Do the changes here </h4>';
}
15. sp_team_pro_after_member_name

This hook allows you to add anything after the member name section. The hook is located in wp-team-pro/src/Frontend/templates/member/name.php (line no: 14)

add_action( 'sp_team_pro_after_member_name', 'changes_after_member_name' );
 
function changes_after_member_name() {
    echo '<h2> Do the changes here </h2>';
}
16. sp_team_pro_before_member_phone

This hook will help you to display anything before the member phone section. The hook is located in wp-team-pro/src/Frontend/templates/member/phone.php (line no: 13)

add_action( 'sp_team_pro_before_member_phone', 'changes_before_member_phone' );
 
function changes_before_member_phone() {
    echo '<h3> Do the changes here </h3>';
}
17. sp_team_pro_after_member_phone

This hook will help you to display anything after the member phone section. The hook is located in wp-team-pro/src/Frontend/templates/member/phone.php (line no: 21)

add_action( 'sp_team_pro_after_member_phone', 'changes_after_member_phone' );
 
function changes_after_member_phone() {
    echo '<h3> Do the changes here </h3>';
}
18. sp_team_pro_before_member_skill

Use this hook to do any changes before member skill. The hook is located in wp-team-pro/src/Frontend/templates/member/skill.php (line no: 12)

add_action( 'sp_team_pro_after_member_skill', 'changes_after_member_skill' );
 
function changes_after_member_skill() {
    echo '<div> Do the changes here </div>';
}
19. sp_team_pro_after_member_skill

Use this hook to do any changes after member skill. The hook is located in wp-team-pro/src/Frontend/templates/member/skill.php (line no: 30)

add_action( 'sp_team_pro_after_member_skill', 'changes_after_member_skill' );
 
function changes_after_member_skill() {
    echo '<div> Do the changes here </div>';
}
20. sp_team_pro_before_member_social

This hook allows you to add anything before the member social icon. The hook is located in wp-team-pro/src/Frontend/templates/member/social.php (line no: 13)

add_action( 'sp_team_pro_before_member_social', 'changes_before_member_social' );
 
function changes_before_member_social() {
    echo '<h3> Do the changes here </h3>';
}
21. sp_team_pro_after_member_social

This hook allows you to add anything after member social icon. The hook is located in wp-team-pro/src/Frontend/templates/member/social.php (line no: 35)

add_action( 'sp_team_pro_after_member_social', 'changes_after_member_social' );
 
function changes_after_member_social() {
    echo '<h3> Do the changes here </h3>';
}
22. sp_team_pro_before_member_website

Use this hook to add anything before the member website. The hook is located in wp-team-pro/src/Frontend/templates/member/website.php (line no: 13)

add_action( 'sp_team_pro_before_member_website', 'changes_before_member_website' );
 
function changes_before_member_website() {
    echo '<h4> Do the changes here </h4>';
}
23. sp_team_pro_after_member_website

This will help you to display anything after the member location. The hook is located in wp-team-pro/src/Frontend/templates/member/website.php (line no: 22)

add_action( 'sp_team_pro_after_member_website', 'changes_after_member_website' );
 
function changes_after_member_website() {
    echo '<h2> Do the changes here </h2>';
}