This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function um_custom_settings_map( $settings_map ) { | |
// changed type to wp_kses for ability to use HTML inside Secondary button title | |
$settings_map['register_secondary_btn_word']['sanitize'] = 'wp_kses'; | |
// please use the line below to remove the sanitizing value before saving to DB. It's highly not recommended because this way you can put your site at risk. | |
// unset( $settings_map['register_secondary_btn_word']['sanitize'] ); | |
return $settings_map; | |
} | |
add_filter( 'um_settings_map', 'um_custom_settings_map', 10, 1 ); | |
// the similar hooks for another places where we need to handle data from inputs and save them to DB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function um_custom_settings_map( $settings_map ) { | |
// let's change and sanitizing for Secondary button word setting and use your own function for that | |
// if you sanitize callback is public function | |
$settings_map['register_secondary_btn_word']['sanitize'] = 'my_custom_sanitize'; | |
// if you sanitize callback inside the class | |
$settings_map['register_secondary_btn_word']['sanitize'] = array( 'my_sanitize_class', 'trim' ); | |
// if it's simple PHP function with the only 1st and single required variable | |
$settings_map['register_secondary_btn_word']['sanitize'] = 'trim'; | |
return $settings_map; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Customize WP_Post object for the restricted post (if it's not hidden) in the archive page | |
* | |
* @param WP_Post $post | |
* @param array $restriction_settings | |
* @param WP_Post $original_post | |
* | |
* @return WP_Post | |
*/ | |
function um_custom_data_restricted_archive_post( $post, $restriction_settings, $original_post ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( function_exists( 'UM' ) ) { | |
remove_action( 'pre_get_posts', array( UM()->access(), 'exclude_posts' ), 99 ); | |
remove_filter( 'get_next_post_where', array( UM()->access(), 'exclude_navigation_posts' ), 99 ); | |
remove_filter( 'get_previous_post_where', array( UM()->access(), 'exclude_navigation_posts' ), 99 ); | |
remove_filter( 'widget_posts_args', array( UM()->access(), 'exclude_restricted_posts_widget' ), 99 ); | |
remove_filter( 'wp_count_posts', array( UM()->access(), 'custom_count_posts_handler' ), 99 ); | |
remove_filter( 'getarchives_where', array( UM()->access(), 'exclude_restricted_posts_archives_widget' ), 99 ); | |
remove_action( 'pre_get_terms', array( UM()->access(), 'exclude_hidden_terms_query' ), 99 ); | |
remove_action( 'pre_get_comments', array( UM()->access(), 'exclude_posts_comments' ), 99 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function um_my_custom_general_search_fields( $custom_fields ) { | |
$custom_fields = array( | |
'zip_code', | |
'user_score', | |
{any_usermeta_key_here}, | |
); | |
return $custom_fields; | |
} | |
add_filter( 'um_general_search_custom_fields', 'um_my_custom_general_search_fields', 10, 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_filter( 'wp_nav_menu_objects', 'um_add_custom_message_to_menu', 9999 ); | |
/** | |
* Add dynamic profile headers | |
* | |
* @param $items | |
* @param $args | |
* | |
* @return mixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'um_prepare_user_query_args', 'um_custom_meta_filter', 10, 2 ); | |
function um_custom_meta_filter( $query_args, $directory_data ) { | |
if ( absint( $directory_data['form_id'] ) === 75648 ) { | |
$query_args['meta_query'][] = array( | |
'key' => 'course_completed_2204', | |
'compare' => 'EXISTS', | |
); | |
} | |
return $query_args; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$GLOBALS['um_custom_redirect'] = false; | |
function um_custom_pre_profile_shortcode( $args ) { | |
global $um_custom_redirect; | |
/** | |
* @var $mode | |
*/ | |
extract( $args ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 'um_before_form_is_loaded', 'um_before_password_form_is_loaded' - action hook for the lostpassword form, use 'um_pre_password_shortcode' for both | |
/** | |
* Fires before Password Reset form loading inside shortcode callback. | |
* | |
* Hook: um_pre_password_shortcode | |
* Note: Use this hook for adding some custom content before the password reset form or enqueue scripts when password reset form shortcode loading. | |
* Legacy v2.x hooks: 'um_before_password_form_is_loaded', 'um_before_form_is_loaded' | |
* | |
* Type: action |