WP Team

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

Hooks: Actions and Filters

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

Filter Hooks:

 

How to Use the Filter Hooks:

1. sp_wp_team_ui_permission
The hook is located in team-free/src/Admin/Admin.php (line no: 175) and
 team-free/src/Admin/Framework/Classes/admin-options.php (line no: 444)
add_filter( 'sp_wp_team_ui_permission','modified_team_ui_permission' );

function modified_team_ui_permission($capability ) {
    $capability = 'manage_options';
    return $capability;
}
2. sp_wp_team_member_post_labels
The hook is located in team-free/src/Admin/Admin.php (line no: 178)
3. sp_wp_team_member_post_args
The hook is located in team-free/src/Admin/Admin.php (line no: 204)
4. sp_team_member_exclude_from_search
The hook is located in team-free/src/Admin/Admin.php (line no: 212)
add_filter( 'sp_team_member_exclude_from_search', 'modified_member_exclude_from_search' );
function modified_member_exclude_from_search( $value ) {
    $value = false;
    return $value;
}
5. sp_wp_team_post_type_labels
The hook is located in team-free/src/Admin/Admin.php (line no: 229)
6. sp_wp_team_post_type_args
The hook is located in team-free/src/Admin/Admin.php (line no: 249)
7. widget_title
8. spf_override
The hook is located in team-free/src/Admin/Framework/Classes/SPF_TEAM.php (line no: 184)
9. spf_fields
The hook is located in team-free/src/Admin/Framework/Classes/SPF_TEAM.php (line no: 167)
10. spf_enqueue_assets
The hook is located in team-free/src/Admin/Framework/Classes/SPF_TEAM.php (line no: 370)
11. spf_color_palette
The hook is located in team-free/src/Admin/Framework/Classes/SPF_TEAM.php (line no: 409)
and
 team-free/src/Admin/Framework/Classes/SPF_TEAM.php (line no: 407)
12. spf_fa4
13. spf_field_typography_backup_font_family
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 113)
And
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 121)
14. spf_field_typography_customwebfonts
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 386)
And
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 415)
add_filter( 'spf_field_typography_customwebfonts', 'modified_spf_field_typography_customwebfonts' );

function modified_spf_field_typography_customwebfonts ( $customwebfonts ) {
    $customwebfonts = array('Roboto','Tahoma');
    return $customwebfonts;
}
15. spf_field_typography_safewebfonts
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 398)
And
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 427)
16. spf_field_typography_googlewebfonts
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 421)
And
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 450)
17. spf_field_typography_defaultstyles
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 426)
And
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 455)
18. spf_field_typography_googlestyles
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 429)
And,
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 458)
19. spf_field_typography_webfonts
The hook is located in team-free/src/Admin/Framework/fields/typography/typography.php (line no: 452)
And
team-free/src/Admin/Partials/Framework/fields/typography/typography.php (line no: 481)
20. spf_wp_editor

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

add_filter( 'spf_wp_editor ', 'modified_spf_wp_editor' );

function modified_spf_wp_editor ( $wp_editor ) {
$wp_editor['tinymce']['wp_skip_init'] = false;
    return $wp_editor;
}
21. spf_field_icon_add_icons
The hook is located in team-free/src/Admin/Framework/functions/actions.php (line no: 30)
And
team-free/src/Admin/Partials/Framework/functions/actions.php (line no: 29)
22. spf_chosen_ajax_capability
The hook is located in team-free/src/Admin/Framework/functions/actions.php (line no: 178)
The hook is located in team-free/src/Admin/Partials/Framework/functions/actions.php (line no: 187)
add_filter( 'spf_chosen_ajax_capability ', 'modified_spf_chosen_ajax_capability' );
function modified_spf_chosen_ajax_capability ($capability ) {
    $capability = 'manage_options';
    return $capability;
}
23. spf_customize_complex_fields
The hook is located in team-free/src/Admin/Framework/functions/customize.php (line no: 94)
And,
team-free/src/Admin/Partials/Framework/functions/customize.php (line no: 101)
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;
}
24. spteam_free_transient_expiration
The hook is located in team-free/src/Frontend/Frontend.php (line no: 69)
25. sp_team_free_dynamic_css
The hook is located in team-free/src/Frontend/Frontend.php (line no: 128)
function modified_sp_team_free_dynamic_css( $value ) {
    return $value;
} 
add_filter( 'sp_team_pro_dynamic_css', 'modified_sp_team_free_dynamic_css' );
26. spteam_free_style_load_in_header
The hook is located in team-free/src/Frontend/Frontend.php (line no: 194)
And,
team-free/src/Frontend/partials/settings.php (line no: 23)
add_filter( 'spteam_free_style_load_in_header', 'modified_style_load_in_header' );

function modified_style_load_in_header( $load_in_header ) {
    $load_in_header = false;
    return $load_in_header;
}
27. sptp_member_job_title
The hook is located in team-free/src/Frontend/Helper.php (line no: 88)
add_filter( 'sptp_member_job_title', 'modified_sptp_member_job_title' );

function modified_sptp_member_job_title( $job_title ) {
    return '<div class="sptp_member_job_title_wrap">' . $job_title . '</div>';
}
28. sptp_preloader
add_filter( 'sptp_preloader', 'modified_sptp_preloader' );
function modified_sptp_preloader( $preloader ) {
    $preloader = '<div class="sptp_preloader">' . $preloader . '"</div>"';
    return $preloader;
}

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

29. spteam_section-title
The hook is located in team-free/src/Frontend/Helper.php (line no: 137)
add_filter( 'spteam_section-title', 'modified_spteam_section-title' );

function modified_spteam_section-title( $section-title ) {
    return '<div class="spteam_section-title_wrap">' . $section-title . '</div>';
}
30. spteam_member_social
The hook is located in team-free/src/Frontend/Helper.php (line no: 166)
add_filter( 'spteam_member_social', 'modified_spteam_member_social' );

function modified_spteam_member_social( $member_social ) {
    return '<div class="spteam_member_social_wrap">' . $member_social . '</div>';
}
31. sptp_member_content
The hook is located in team-free/src/Frontend/Helper.php (line no: 196)
add_filter( 'sptp_member_content', 'modified_sptp_member_content' );

function modified_sptp_member_content( $member_content ) {
    return '<div class="sptp_member_content_wrap">' . $member_content . '</div>';
}
32. spteam_member_description
The hook is located in team-free/src/Frontend/Helper.php (line no: 200)
add_filter( 'spteam_member_description', 'modified_spteam_member_description' );

function modified_spteam_member_description( $member_description ) {
    return '<div class="spteam_member_description_wrap">' . $member_description . '</div>';
}
33. spteam_member_name
The hook is located in team-free/src/Frontend/Helper.php (line no: 223)
add_filter( 'spteam_member_name', 'modified_spteam_member_name' );

function modified_spteam_member_name( $member_name ) {
    return '<div class="spteam_member_name_wrap">' . $member_name . '</div>';
}
34. spteam_member_image
The hook is located in team-free/src/Frontend/Helper.php (line no: 298)
add_filter( 'spteam_member_image', 'modified_spteam_member_image' );

function modified_spteam_member_image( $member_image ) {
    return '<div class="spteam_member_image_wrap">' . $member_image . '</div>';
}
35. sptp_member_placeholder_image_src
The hook is located in team-free/src/Frontend/Helper.php (line no: 424)
add_filter( 'sptp_member_placeholder_image_src', 'modified_sptp_member_placeholder_image_src' );

function modified_sptp_member_placeholder_image_src( $image_src ) {  
    return '<div class="image_src_wrap">' . $image_src . '</div>';
}
36. sptp_placeholder_image_width
The hook is located in team-free/src/Frontend/Helper.php (line no: 428)
add_filter( 'sptp_placeholder_image_width', 'modified_sptp_placeholder_image_width' );

function modified_sptp_placeholder_image_width( $image_width ) {
    return '<div class="image_width_wrap">' . $image_width . '</div>';
}
37. sptp_placeholder_image_height
The hook is located in team-free/src/Frontend/Helper.php (line no: 429)
add_filter( 'sptp_placeholder_image_height', 'modified_sptp_placeholder_image_height' );

function modified_sptp_placeholder_image_height( $image_height ) {
    return '<div class="image_height_wrap">' . $image_height . '</div>';
}
38. spteam_free_style_load_in_header
The hook is located in team-free/src/Frontend/Frontend.php (line no: 194)
And
team-free/src/Frontend/sertials/settings.php (line no: 23)
add_filter( 'spteam_free_style_load_in_header', 'modified_spteam_free_style_load_in_header' );

function modified_spteam_free_style_load_in_header( $value ) {
 return $value = false;
}

 

How to Use the Action Hooks:

1. spf_options_after

The hook is located in wp-team-pro/src/Frontend/partial/dynamic-style.php (line no: 690)

2. spf_init

The hook is located in wp-team-pro/src/Frontend/templates/section-title.php (line no: 10)

3. spf_loaded

The hook is located in wp-team-pro/src/Frontend/templates/section-title.php (line no: 12)

4. spf_enqueue

The hook is located in wp-team-pro/src/Frontend/templates/member/description.php (line no: 10)

5. media_buttons

The hook is located in wp-team-pro/src/Frontend/templates/member/description.php (line no: 12)

6. wp_nav_menu_item_custom_fields

The hook is located in wp-team-pro/src/Frontend/templates/member/email.php (line no: 14)

7. sp_team_before_section_title

The hook is located in wp-team-pro/src/Frontend/templates/member/email.php (line no: 22)

add_action( 'sp_team_before_section_title', 'modified_sp_team_before_section_title', 10 );

function modified_sp_team_before_section_title() {  
return '<a href="'.get_the_permalink().'">';
}
8. sp_team_after_section_title

The hook is located in wp-team-pro/src/Frontend/templates/member/job-title.php (line no: 22)

add_action( 'sp_team_after_section_title', 'modified_sp_team_after_section_title', 10 );

function modified_sp_team_after_section_title() {    
    return '</a>';
}
9. sp_team_before_member_description

The hook is located in wp-team-pro/src/Frontend/templates/member/job-title.php (line no: 24)

add_action('sp_team_before_member_description', 'changes_before_description');
function changes_before_description() {
    echo '<div> your customization here! </div>';
}
10. sp_team_after_member_description

The hook is located in wp-team-pro/src/Frontend/templates/member/location.php (line no: 12)

add_action('sp_team_after_member_description', 'changes_after_description');

function changes_after_description() {
    echo '<div> do the customization here </div>';
}
11. sp_team_before_member_job_title

The hook is located in wp-team-pro/src/Frontend/templates/member/location.php (line no: 19)

add_action('sp_team_before_member_job_title', 'changes_before_member_job_title');
function changes_before_member_job_title() {
    echo '<div> your customization here! </div>';
}
12. sp_team_after_member_job_title

The hook is located in wp-team-pro/src/Frontend/templates/member/mobile.php (line no: 13)

add_action('sp_team_after_member_job_title', 'changes_after_member_job_title');
function changes_after_member_job_title() {
    echo '<div> your customization here! </div>';
}
13. sp_team_before_member_name

The hook is located in wp-team-pro/src/Frontend/templates/member/mobile.php (line no: 21)

add_action('sp_team_before_member_name', 'changes_before_member_name');
function changes_before_member_name() {
    echo '<div> your customization here! </div>';
}
14. sp_team_after_member_name

The hook is located in wp-team-pro/src/Frontend/templates/member/name.php (line no: 12)

add_action('sp_team_after_member_name', 'changes_after_member_name');
function changes_after_member_name() {
    echo '<div> your customization here! </div>';
}
15. sp_team_before_member_social

The hook is located in wp-team-pro/src/Frontend/templates/member/name.php (line no: 14)

add_action('sp_team_before_member_social', 'changes_before_member_social');
function changes_before_member_social() {
    echo '<div> your customization here! </div>';
}
16. sp_team_after_member_social

The hook is located in wp-team-pro/src/Frontend/templates/member/phone.php (line no: 13)

add_action('sp_team_after_member_social', 'changes_after_member_social');
function changes_after_member_social() {
    echo '<div> your customization here! </div>';
}