How to do something when user profile rendereing?

I’m not sure I understand your question correctly, but I give it a try… <?php function remove_xprofile_links() { global $current_user; get_currentuserinfo(); $user_id = $current_user->ID; $field = xprofile_get_field_data(3, $user_id); $class=”normal-profile”; if ($field == ‘{whatever}’) { $class=”hidden-profile”; } $html=”<div class=”” .$class . ‘”>’ . $field . ‘</div>’; echo $html; ?> And in css you should have .hidden-profile … Read more

Pass get data from anchor URL [closed]

The problem you are encountering is that WordPress and your browser are interpreting everything after the “#” as a client side hash. In other words, PHP and WordPress never see the “?tier=Test1” bit. There are few ways to fix the issue though I’m not sure which will be most efficient in your situation: 1) Trigger … Read more

Sorting users by a field, not by ID

By passing orderby and order arguments in array. $args = array( ‘orderby’ => ‘login’, ‘order’ => ‘ASC’, ); get_users( $args ); orderby – Sort by ‘ID’, ‘login’, ‘nicename’, ’email’, ‘url’, ‘registered’, ‘display_name’, ‘post_count’, ‘include’, or ‘meta_value’ (query must also contain a ‘meta_key’ – see WP_User_Query). More details : https://codex.wordpress.org/Function_Reference/get_users

Implementing custom tag/tax pages

You can use the tag_template or taxonomy_template filters and check the queried object from within that, then use locate_template to get the template path. function wpd_tag_template_filter( $templates=”” ) { $this_tag = get_queried_object(); // check $this_tag->term_id, $this_tag->slug, etc. $templates = locate_template( ‘my_custom_template.php’, false ); return $templates; } add_filter( ‘tag_template’, ‘wpd_tag_template_filter’ );

Image rotation issue (horizontal picture uploading as vertical) — Exif issue?

summersummer solved the problem reported by installing the Image Rotation Repair, which describes itself as follows: The Image Rotation Repair plugin simply fixes image orientation based on EXIF data. This is primarily a patch for mis-oriented images delivered from iPhones. Functionally it filters all uploads and if EXIF->Orientation is set to a number greater than … Read more

Why BuddyPress fields not saving?

The user_register hook probably fires too early. Try: add_action( ‘bp_core_signup_user’, ‘auto_login_new_user’, 100, 1 ); $user_id is passed by the bp_core_signup_user hook.

PHP Warning: Missing argument 2

You are hooking select_age() to wpcf_after_init which more than likely does not accept two arguments. I am not sure why you are hooking into that hook but it is not necessary for a shortcode, nor is there any obvious reason in the code.

Storing content into a custom taxonomy

Your question is confusing but assuming that you want your array to be an argument set for, say, wp_insert_post() then… I am wondering how I can include it into the array for posting with the content from the string provided in the example. … you need tax_input. I am pretty sure I’ve got this right: … Read more