Are you looking for this?
function convertInterestCategory() {
$interest_categories = array(
'interest_disaster',
'interest_animals',
'interest_women',
'interest_seniors',
'interest_hunger_health',
'interest_education',
'interest_environment',
'interest_arts_culture',
'interest_children_youth',
'interest_other',
'interest_mentoring',
'interest_poverty_urban'
);
$current_user = wp_get_current_user();
$user_values = get_user_meta( $current_user->ID );
foreach ( $interest_categories as $interest_category ) {
if ( isset( $user_values[$interest_category][0] ) )
echo $user_values[$interest_category][0];
}
}
Related Posts:
- Array: What is this value based on?
- Adding Custom User Profile data based upon Categories
- Return array of categories to php function
- Listing all posts from current category on page
- Display WooCommerce product categories in a 4 columns custom menu [closed]
- Show post only if match all categories
- Dropdown category filter
- Force a user’s posts category
- Resort get_categories
- How to use an array of categories as a dropdown?
- Create menu locations for each category in wordpress
- Use premade array as categories in wp_query?
- How to get an array with all categories and corresponding names?
- Link To Child Category For A Post
- List a maximum of ‘x’ product categories with qty of ‘y’ in each column
- Need to echo category id in multi-dimensional array
- Getting Category Children
- I need to exclude from a query a category and a few custom taxonomies
- Let user select their own category
- Mass Update User Profile Checkbox Options
- Cant get unique_array() work on get_the_category() foreach loop
- How to change category id on get_posts array
- How to define category ID in an array?
- Order Categories by Character Count
- how do I exclude a category foreach
- A simple question regarding tags and categories
- hierarchical taxonomy in permalinks? using same slug
- Lowest catagory link
- how to Specifies an author / editor to edit one category only?
- Display one post on category.php: Wrong featured image
- foreach,having wp_query inside, breaks after showing one result
- Category and tags goes 404
- Display related posts with same category or same tag return blank
- Get posts from 2 or more categories
- Display a category name automatically using code in the functions.php file
- Removing categories, Comments etc from posts?
- WordPress edit.php category filter to show only posts from direct category and not posts from it child category
- $args Orderby The number
- Wrong category being displayed in URL
- How can I just show portfolio items from 1 category on portfolio page?
- get_adjacent_post_link excluded_terms ignored
- Most efficient way to have 1 template for parent, 1 template for child categories?
- Category foreach Paging
- Match two taxonomies to display a specific content
- Include category name in page template
- How to add a new child category via an SQL statement?
- Display all of a post’s categories except the current category
- If on Category Page add “active” class?
- How to count the number of monthly archive?
- Categories in media library
- Alphabetize all but one category
- WordPress Shop and restricting products and categories for some users/groups
- Pass list of categories to JS
- How can I allow people to ‘subscribe’ to categories?
- get categories the post was in and just been removed from
- WP url to get rss with full text of post
- Category menu that filters out empty categories
- Transfering static site to wordpress and retaining category by month paginations
- Display Referring Category on single post?
- Loop through posts of CatA and store value of CatB in separate array
- Category Templates for Post Types not Working
- Change category base based on category
- Conditional statements based on custom meta value in category archives
- Highlight posts that belong to current sub category
- How to make 10 post of one category
- Conditions for single post
- How to add an empty entry to masonry?
- ACF plugin categories bug in WordPress 3.9
- List Categories in Custom Order
- Pages with posts filtered by category
- Querying Multiple Categories With Different Offsets
- Own Custom Tags/Category page ( posts)
- How can I hide the category term for posts with none set?
- Allow duplicate permalink slugs for posts in different categories
- Hide all posts by an author
- How to display post title and link within wp_list_categories()
- filter single_cat_title avoiding the breadcrumbs
- How to remove title from category page in header
- htaccess redirect for all categories converted to tags now showing 404
- woocommerce – products by category slug? [closed]
- Gettind 404 not found wen click the view button for a given category custom post type portfolio
- Link to a latest news item with correct url
- How to create default categories in new installs?
- Automatic menu creation for pages with categories?
- WordPress Numeric Pagination with Query String [duplicate]
- How can I add a Categories page link to a menu? [closed]
- Changing Permalinks for Category Pages Only
- Custom category for posts via XMLRPC
- Displaying posts from a Category where the Category ID or slug is not known
- Taxonomy for custom post type not found
- Custom CSS to resize elements in multiple categories
- DESC order not working when showing only child categories
- Children categories not shown in dashboard
- Loops in category description
- Media Library filter returns undefined function get_current_screen
- date.php shows all posts. how to fix it?
- How to get multiple loop in category.php, my scripts becomes madness
- Help with Wp + Mixitup code
- Function to list posts from current post’s category fails in WP 3.8
- Multiple parent categories