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
/** | |
* Sample usage: [um_embed_profile user_id="123" form_id="3"] | |
*/ | |
add_shortcode("um_embed_profile","um_082321_embed_specific_profile"); | |
function um_082321_embed_specific_profile( $atts ){ | |
$atts = shortcode_atts( array( | |
'user_id' => get_current_user_id(), | |
'form_id' => 0, | |
), $atts ); |
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
function um_051221_site_locale(){ | |
$arr = [ | |
"en" => "English (United States)", | |
'cs_CZ' => "Čeština", | |
'es_AR' => "Español de Argentina", | |
]; | |
return $arr; | |
} |
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
/** | |
* Tutorial: https://www.champ.ninja/2020/05/add-a-custom-account-tab-with-profile-form-fields/ | |
*/ | |
add_filter("um_user_pre_updating_files_array", function($files ){ | |
$user_id = get_current_user_id(); | |
if( empty( $user_id ) ) return $files; | |
$new_files = 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
add_filter("um_user_profile_tabs", function( $tabs ){ | |
$arr_followers = $tabs['followers']; | |
$arr_following = $tabs['following']; | |
unset( $tabs['followers'] ); | |
unset( $tabs['following'] ); | |
$tabs['followers'] = $arr_followers; |
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
add_filter( 'wpcf7_mail_components', 'um_020821_change_email_to_profile_owner_email', 10, 3 ); | |
function um_020821_change_email_to_profile_owner_email( $args, $contact_form, $class){ | |
if ( class_exists( '\WPCF7_Submission' ) ) { | |
$submission = \WPCF7_Submission::get_instance(); | |
$page = $submission->get_meta( 'container_post_id' ); | |
if ( intval( UM()->options()->get( 'core_user' ) ) == intval( $page ) ) { | |
if ( ! empty( $_REQUEST['_wpcf7_um_profile_id'] ) ) { | |
$user = get_user_by( 'ID', absint( $_REQUEST['_wpcf7_um_profile_id'] ) ); | |
if ( ! is_wp_error( $user ) && isset( $user->user_email ) && is_email( $user->user_email ) ) { |
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
// Usage: Add this short tag to any Email Template in UM > Email settings: {password_reset_link_v2} | |
/** | |
* UM Placeholders for reset password | |
* | |
* @param $placeholders | |
* | |
* @return array | |
*/ | |
function um_121520_add_placeholder( $placeholders ) { |
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
/** | |
* Add a shortcode to display the Login URL with redirection URL | |
* e.g. http://www.yoursite.com/login/?redirect_to=http://www.yoursite.com/content-restriction/ | |
* www.champ.ninja | |
*/ | |
add_shortcode("um_login_redirect","um_login_redirect",10, 2 ); | |
function um_login_redirect( $atts, $content ){ | |
global $wp; |
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 | |
/** | |
* Imports files and images( except cover and profile photo ) | |
* @since UM 2.0 | |
* | |
* Sample Usage: | |
* - Fields should be created first in the UM Form Builder. | |
* - Files should be added to /wp-content/uploads/ultimatemember/<user_id>/ before running the import function. | |
* | |
* add_action('init', function(){ |
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 if ( ! defined( 'ABSPATH' ) ) exit; ?> | |
<!-- This file should primarily consist of HTML with a little bit of PHP. --> | |
<div class="um-field um-field-type_terms_conditions" data-key="use_terms_conditions_agreement" style="display:block;padding:0;"> | |
<div class="um-field-area"> | |
<?php $confirm = ! empty( $args['use_gdpr_agreement'] ) ? $args['use_gdpr_agreement'] : __( 'Please confirm that you agree to our privacy policy', 'ultimate-member' ); ?> | |
<label class="um-field-checkbox"> |