User Meta Value not echoing despite Var_Dump Showing correct string
The $havemeta variable isn’t defined inside your shopping_location_text() function, so it isn’t available for use there. For a quick fix (or for testing/toying) you can move your code inside the function, like this: add_action( ‘woocommerce_before_main_content’, ‘shopping_location_text’, 10 ); function shopping_location_text() { global $current_user; get_currentuserinfo(); // wordpress global variable to fetch logged in user info $userID … Read more