Current User In Custom Menu Item URL [closed]

Congrats on figuring it out. Perhaps this would also work: function change_menu($items){ foreach($items as $item){ if ($item-> post_name == ‘the-slug’)/*replace “the-slug” with menu item post_name */ $item->url = bp_loggedin_user_domain() . ‘/events/my-events/?action=edit’; } return $items; } add_filter(‘wp_nav_menu_objects’, ‘change_menu’);

How to get its meta_value of a specific meta_key within wp_usermeta

@Cristián Lávaque Thank you for the hints 😉 Actually I managed to resolve the issue blocking this function (show the hidden comment above). In case this would help anyone here is the final working code: function check_post_limit() { if ( current_user_can( ‘edit_posts’ ) ) { global $userdata; global $wpdb; $s2member_last_payment_time = get_user_meta( get_current_user_id(), ‘wp_s2member_last_payment_time’, true … Read more

editing usermeta when field is an array

This code is your problem: $s2_custom=get_user_meta($u->ID, ‘wp_s2member_custom_fields’); $real = $s2_custom[0]; $real[‘loomsong_del’]=’email’; update_user_meta($u->ID, ‘wp_s2member_custom_fields’,$real); get_user_meta returns an array of the meta values. Since in this case there’s only a single value with the array, you need to pass the single parameter to it. Try this: $s2_custom=get_user_meta($u->ID, ‘wp_s2member_custom_fields’, true); $s2_custom[‘loomsong_del’]=’email’; update_user_meta($u->ID, ‘wp_s2member_custom_fields’,$s2_custom); This won’t fix your already … Read more

tech