Profile Tab Filter for CPT (reference)
add_filter(“um_profile_query_make_posts”,”um_custom_posts_query”); function um_custom_posts_query( $args ){ $args[‘post_type’] = [‘gallery_post’,’yearbook’]; return $args; }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter(“um_profile_query_make_posts”,”um_custom_posts_query”); function um_custom_posts_query( $args ){ $args[‘post_type’] = [‘gallery_post’,’yearbook’]; return $args; }Continue reading
add_filter(‘upload_mimes’,’restrict_mime’); function restrict_mime($mimes) { //global $current_user; //get_currentuserinfo(); // change users in list //$users = array( //”ryan”, //”steven”, //”larry”, //”jerry” //); //if (!in_array($current_user->user_login, $users)) { if ( !current_user_can( ‘manage_options’ ) ) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘webp’ => ‘image/webp’,…Continue reading
function per_user_upload_dir( $original ){ $modified = $original; if( ( isset( $_REQUEST[‘action’] ) && ( “um_resize_image” == $_REQUEST[‘action’] || “um_imageupload” == $_REQUEST[‘action’] ) ) || isset( $_REQUEST[‘um_action’] ) ){ return $original; } elseif ( is_user_logged_in() && !current_user_can( ‘manage_options’ ) ) {…Continue reading
add_filter(‘acf/upload_prefilter/name=gallery_post_featured_image’, ‘per_user_upload_prefilter’); function per_user_upload_prefilter($errors) { // in this filter we add a WP filter that alters the upload path add_filter(‘upload_dir’, ‘per_user_upload_dir’); return $errors; } // second filter function per_user_upload_dir($uploads) { // here is where we alter the path $current_user =…Continue reading
add_action(“um_after_user_status_is_changed”,”um_011822_delete_account_on_rejection”, 10, 2); function um_011822_delete_account_on_rejection( $status, $user_id ) { if( “rejected” == $status ) { // Disable delete notification on rejection and deletion UM()->user()->send_mail_on_delete = false; if ( is_multisite() ) { if ( ! function_exists( ‘wpmu_delete_user’ ) ) { require_once(…Continue reading
add_filter( ‘wfea_combined_date_time_date_format’, function ( $format ) { return ‘F j,Y @ H:i’; } , 999 );Continue reading
add_filter( ‘wpcode_pixel_event_name_facebook’, function ( $event_name, $event_key ) { if ( ‘purchase’ === $event_key ) { return ‘Subscribe’; } return $event_name; }, 10, 2 );Continue reading
add_filter(‘comments_open’, function ($open, $post_id) { $post = get_post($post_id); if ($post->post_type == ‘event’) { return false; } return $open; }, 10, 2);Continue reading
add_filter( ‘qem_event_register’, /** * @param $args https://developer.wordpress.org/reference/functions/register_post_type/#parameters * * @return array */ function ( $args ) { $args[‘rewrite’] = array( ‘slug’ => ‘my_custom_event_slug’ ); return $args; }, 10, 1 );Continue reading