Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. add_action( 'woocommerce_before_main_content', 'shopping_location_text', 10 );
  2. global $current_user;
  3. get_currentuserinfo(); // wordpress global variable to fetch logged in user info
  4. $userID = $current_user->ID; // logged in user's ID
  5. $havemeta = get_user_meta($userID, 'location_select', true); // stores the value of logged in user's meta data for 'location_select'.
  6. var_dump($havemeta);
  7.  
  8. function shopping_location_text() {
  9. if( is_shop() ) {
  10. print '<p class="shopping-location-text">YOUR ARE CURRENTLY SHOPPING IN <span style="FONT-WEIGHT: 700;COLOR: #fa4516;">' . $havemeta . '</span></p>';
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement