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 | |
| add_action( 'wp_enqueue_scripts', 'um_remove_old_css', UM()->enqueue()->get_priority() + 1 ); | |
| if ( ! function_exists( 'um_remove_old_css' ) ) { | |
| function um_remove_old_css() { | |
| wp_dequeue_style( 'um_default_css' ); | |
| wp_dequeue_style( 'um_old_css' ); | |
| } | |
| } |
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 | |
| add_action('tutor_student/before/wrap', 'display_tutor_msg' ); | |
| function display_tutor_msg(){ | |
| $user_name = sanitize_text_field(get_query_var('tutor_student_username')); | |
| $sub_page = sanitize_text_field(get_query_var('profile_sub_page')); | |
| $get_user = tutor_utils()->get_user_by_login($user_name); | |
| $user_id = $get_user->ID; |
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 | |
| add_action( 'init', 'hide_secure_wp_admin' ); | |
| function hide_secure_wp_admin() { | |
| if ( is_admin() || $GLOBALS['pagenow'] === 'wp-login.php' ) { | |
| // Non logged in users. | |
| if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) { | |
| wp_redirect( um_get_core_page('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
| {{{user.data_field}}} | |
| // eg: {{{user.country}}} |
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 | |
| /** | |
| * Remove um-old-default.css | |
| * UM Dequeue Old UM CSS File. | |
| * Removes the um-old-default.css | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'remove_um_old_css', UM()->enqueue()->get_priority() + 1 ); | |
| if ( ! function_exists( 'remove_um_old_css' ) ) { | |
| function remove_um_old_css() { |
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_profile_tabs', 'add_post_tab_only_model_role', 1000 ); | |
| function add_post_tab_only_model_role( $tabs ) { | |
| $display_roles = array( 'model' ); | |
| if ( !in_array( um_user('role') , $display_roles ) ) { | |
| unset($tabs['posts']); | |
| } | |
| return $tabs; |
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 | |
| add_filter( 'post_class', 'um_add_restricted_class_css', 10, 1 ); | |
| function um_add_restricted_class_css($classes){ | |
| global $post; | |
| $restriction = get_post_meta( $post->ID, 'um_content_restriction', true ); | |
| // if the post is restricted do this. | |
| if ( $restriction['_um_accessible'] == 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
| <?php | |
| /* | |
| Code snippet of Plugin Ultimate Member | |
| URL: https://wordpress.org/plugins/ultimate-member/ | |
| */ | |
| // WP_User_Query arguments | |
| $args = array( | |
| 'fields' => 'ID', | |
| 'order' => 'ASC', |
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 | |
| add_action("adverts_post_type", "customize_adverts_post_type"); | |
| function customize_adverts_post_type( $args ) { | |
| $args["supports"][] = "thumbnail"; | |
| return $args; | |
| } |
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( 'wp_enqueue_scripts', 'core_functionality_dequeue_UM_styles', 1000 ); | |
| /** | |
| * Remove all 21 CSS files of UM | |
| * Remove all 21 JS files of UM | |
| * | |
| */ | |
| function core_functionality_dequeue_UM_styles(){ | |
| if ( class_exists( 'UM' ) ) return; | |