@missveronicatv
https://imgur.com/a/CxHd56v – i’ve disable cache for users after i posted. Should i unstick tables?
And i’m using those custom codes in my function.php, could any of them doing problems?
////////////////////////////////////////////////////////////////////////
// Ultimate Member Profile Display Name Integration ////////////////////
////////////////////////////////////////////////////////////////////////
add_filter('wpdiscuz_comment_author', 'wpdiscuz_um_author', 10, 2);
function wpdiscuz_um_author($author_name, $comment) {
if ($comment->user_id) {
$column = 'display_name'; // Other options: 'user_login', 'user_nicename', 'nickname', 'first_name', 'last_name'
if (class_exists('UM_API') || class_exists('UM')) {
um_fetch_user($comment->user_id); $author_name = um_user($column); um_reset_user();
} else {
$author_name = get_the_author_meta($column, $comment->user_id);
}
}
return $author_name;
}
////////////////////////////////////////////////////////////////////////
// Ultimate Member Profile URL Integration /////////////////////////////
////////////////////////////////////////////////////////////////////////
add_filter('wpdiscuz_profile_url', 'wpdiscuz_um_profile_url', 10, 2);
function wpdiscuz_um_profile_url($profile_url, $user) {
if ($user && (class_exists('UM_API') || class_exists('UM'))) {
um_fetch_user($user->ID); $profile_url = um_user_profile_url();
}
return $profile_url;
}
function um_custom_validate_bot_spam( $key, $array, $args ) {
if ( isset( $args[$key] ) && $args[$key] != 'ОТАКУ ФЕН' ) {
UM()->form()->add_error( $key, __( 'Напишете думите правилно и с главни букви.', 'ultimate-member' ) );
}
}
add_action( 'um_custom_field_validation_bot_spam', 'um_custom_validate_bot_spam', 30, 3 );
add_filter( 'auto_update_plugin', '__return_false' );
/* Disable oEmbeds author name & author url ~ Stops Showing in embeds */
add_filter( 'oembed_response_data', 'disable_embeds_filter_oembed_response_data_' );
function disable_embeds_filter_oembed_response_data_( $data ) {
unset($data['author_url']);
unset($data['author_name']);
return $data;
}
add_filter( "um_user_profile_tabs", "um_072522_add_comment_count", 1000 );
function um_072522_add_comment_count( $tabs ) {
if( isset( $tabs['comments'] ) && ! isset( $tabs['comments']['notifier'] ) ){
$args = array(
'user_id' => um_profile_id(), // Use user_id.
'count' => true // Return only the count.
);
$comments_count = get_comments( $args );
$tabs['comments']['notifier'] = $comments_count;
}
return $tabs;
-
This reply was modified 1 year, 2 months ago by
qnkov.