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 fmwp_topic_data_custom( $topic_args, $topic ) { | |
$author = get_userdata( $topic->post_author ); | |
$topic_args['author_username'] = $author->user_login; | |
if ( ! empty( $topic_args['people'] ) ) { | |
foreach ( $topic_args['people'] as $people ) { | |
$user = get_userdata( $people['id'] ); | |
if ( $topic->post_author == $people['id'] ) { | |
$people['avatar']['title'] = sprintf( __( 'Created by %s', 'forumwp' ), $user->user_login ); |
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_recaptcha_language_code( $lang ) { | |
if ( UM()->external_integrations()->is_wpml_active() ) { | |
global $sitepress; | |
$language_code = $sitepress->get_current_language(); | |
if ( $language_code == 'zh-hant' ) { | |
$lang = 'zh-TW'; | |
} | |
} |
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
// Please replace 'my-custom-key' to your real meta key | |
// there can be more than 1 custom meta fields | |
function jb_custom_job_data( $data, $job_id ) { | |
$data['my-custom-key'] = get_post_meta( $job_id, 'my-custom-key', true ); | |
return $data; | |
} | |
add_filter( 'jb-job-raw-data', 'jb_custom_job_data', 10, 2 ); |
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_markers( $args ) { | |
if ( is_user_logged_in() && ! empty( UM()->Messaging_API() ) ) { | |
if ( um_profile( 'ID' ) != get_current_user_id() && | |
! empty( UM()->Messaging_API()->api()->get_conversation_id( um_profile( 'ID' ), get_current_user_id() ) ) { | |
echo 'some HTML with marker'; | |
} | |
} | |
} | |
add_action( 'um_profile_header', 'um_custom_markers', 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
function um_custom_profile_before_header( $args ) { | |
remove_filter( 'um_profile_tabs', 'um_followers_add_tabs', 2000 ); | |
remove_action( 'um_profile_navbar', 'um_followers_add_profile_bar', 4 ); | |
} | |
add_action( 'um_profile_before_header', 'um_custom_profile_before_header', 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
<?php | |
// if REMOTE_ADDR is empty or not correct you may use HTTP_X_FORWARDED_FOR or HTTP_CF_CONNECTING_IP | |
if ( isset( $_SERVER['REMOTE_ADDR'] ) && '{here your current IP}' == $_SERVER['REMOTE_ADDR'] ) { | |
if ( ! class_exists( 'UM_TEST_BAR' ) ) { | |
class UM_TEST_BAR { |
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_reset_member_directory( $args ) { | |
?> | |
<a href="<?php echo um_get_core_page( 'members' ) ?>" class="um-button um-alt"><?php _e( 'Reset', 'ultimate-member' ) ?></a> | |
<a> | |
<?php | |
} | |
add_action( 'um_members_directory_head', 'um_custom_reset_member_directory', 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
/** | |
* A job's custom data | |
* | |
* @param array $data | |
* @param WP_Post $job_post | |
* | |
* @return array | |
**/ | |
function jb_custom_job_data( $data, $job_post ) { | |
$data = [ |
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_restriction_settings( $restriction, $post ) { | |
if ( ! is_user_logged_in() && um_is_core_post( $post, 'user' ) ) { | |
$restriction_meta = get_post_meta( $post->ID, 'um_content_restriction', true ); | |
if ( $restriction_meta['_um_accessible'] == '2' && $restriction_meta['_um_noaccess_action'] == '0' ) { | |
$restriction = $restriction_meta; | |
} | |
} | |
return $restriction; | |
} |
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_profile_restriction( $exclude, $post ) { | |
if ( $exclude ) { | |
if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) { | |
if ( um_is_core_post( $post, 'user' ) ) { | |
$exclude = false; | |
} | |
} | |
} | |
return $exclude; | |
} |