This file contains 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 | |
// Add custom email notifications. | |
add_filter( 'um_email_notifications', 'onemec_email_notifications', 10, 1 ); | |
// Call action when a new Job is published. | |
add_action( 'jb_job_published', 'onemec_job_submitted', 10, 2 ); | |
/** | |
* Extend Ultimate Member email notifications. |
This file contains 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 | |
// apply shortcodes in the "Content Block" field. | |
add_filter( 'um_get_field_block', function( $data ) { | |
if ( array_key_exists( 'content', $data ) ) { | |
$data['content'] = apply_shortcodes( $data['content'] ); | |
} | |
return $data; | |
} ); |
This file contains 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 | |
/** | |
* This file overrides the default template account.php | |
* | |
* Page: "Account" | |
* | |
* @version 2.9.2 | |
* | |
* @var string $mode | |
* @var int $form_id |
This file contains 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 | |
/** | |
* Add a new real-time notification type 'new_photo_comment'. | |
* | |
* @param array $array Notification types. | |
* @return array | |
*/ | |
function um_user_photos_add_notification_type( $array ) { | |
$array['new_photo_comment'] = array( |
This file contains 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 | |
// Redirect logged in users from the Login page to the page specified in the role setting “Set Custom Redirect URL”. | |
add_action( 'template_redirect', function() { | |
if ( function_exists( 'um_is_core_page' ) && um_is_core_page( 'login' ) && is_user_logged_in() ) { | |
if ( um_user( 'login_redirect_url' ) ) { | |
$redirect_url = apply_filters( 'um_login_redirect_url', um_user( 'login_redirect_url' ), um_user( 'ID' ) ); | |
} else { | |
$redirect_url = home_url(); | |
} |
This file contains 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 | |
/** | |
* Shortcode that displays the profile data. | |
* Example: [um_user data="roles" user_id="1"] | |
* | |
* @param array $atts Shortcode attributes: | |
* - (string) data - Data type or usermeta key. Display name by default | |
* - (int) user_id - User ID. Profile ID or current user ID by default. | |
* |
This file contains 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 | |
// Disable the default "Bookmark" button in the post content. | |
if ( defined( 'um_user_bookmarks_version' ) ) { | |
remove_filter( 'the_content', array( UM()->User_Bookmarks()->common(), 'add_um_user_bookmarks_button' ), 20 ); | |
remove_filter( 'the_excerpt', array( UM()->User_Bookmarks()->common(), 'add_um_user_bookmarks_button_excerpt' ), 9999 ); | |
} |
This file contains 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 | |
// Disable content restriction for searching. | |
add_action( 'wp_loaded', function() { | |
if ( ( is_search() || isset( $_GET['s'] ) ) && function_exists( 'UM' ) ) { | |
remove_action( 'template_redirect', array( UM()->access(), 'template_redirect' ), 1000 ); | |
remove_action( 'pre_get_terms', array( UM()->access(), 'exclude_hidden_terms_query' ), 99 ); | |
remove_filter( 'widget_posts_args', array( UM()->access(), 'exclude_restricted_posts_widget' ), 99 ); | |
remove_filter( 'wp_list_pages_excludes', array( UM()->access(), 'exclude_restricted_pages' ) ); |
This file contains 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 | |
// Hide the "Friends" extension elements for guests. | |
if ( ! is_user_logged_in() && defined( 'um_friends_version' ) ) { | |
// A button in profile cover area. | |
remove_action( 'um_before_profile_main_meta', 'um_friends_add_button', 10 ); | |
// A button in profile meta area. | |
remove_action( 'um_after_profile_header_name', 'um_friends_add_button_nocover', 60 ); |
This file contains 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 | |
/** | |
* Custom validation and error message for the "Password Reset" field. | |
*/ | |
add_action( 'um_reset_password_errors_hook', 'um_custom_validate_reset_password_email', 20 ); | |
function um_custom_validate_reset_password_email( $inputs ) { | |
if ( isset( $inputs['username_b'] ) ) { | |
if ( isset( UM()->form()->errors['username_b'] ) ) { | |
unset( UM()->form()->errors['username_b'] ); |
NewerOlder