Add User Role: Pre-saved in User-Meta [SOLVED]

That’s because you’re not passing an actual ID to get_user_meta, but merely a string of id: $get_portal_number = get_user_meta(‘id’, ‘portal_number’, false); In addition, the third parameter is set to false, which will return an array. You’re passing that value straight to $user->add_role, but that expects a string. You either have to loop over your post … Read more

plugin wraps the entire content

There are 2 major problems. The first is that you output the opening div directly in the shortcode. Shortcodes must never echo or output directly, they always return a HTML string. As a result, before the post content is even displayed, this has already been sent to the browser: <div class=”blog__grid”> You’re very lucky you’re … Read more

get specific value of a array | PHP

The previous answer is wrong, to access the array elements, you need to get it by the key: $location = $release_edu_qual[0][“location”]; In the above code, we’re getting the location of the array that’s first (zero based) in the initial array. So to list all the array data you want from that initial array you could … Read more