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
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Gutenberg editor add a custom category as wrapper for custom blocks
- Rewrite rule page url with category
- Different template for subcategories
- WP_Query not looking at child category
- Deleting default category in wordpress
- Most recent post from every category/taxonomy but sorted by date
- Category Archive, list subcategories of each post
- Disable pagination only for specific category
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Script to duplicate categories as tags
- Check if post belongs to any category
- How to add categories to products in woocommerce programatically? [closed]
- How to sort categories by id in wordpress admin
- How to override Category rendering mechanism
- Remove Parent Category from Child Category URL
- Multisite – create a category in specific site
- Allow users to post to a certain category
- Do I have to use categories?
- get_the_category and echo out link to child-most/deepest category
- Categorising posts/pages into years published
- Convert the default sub-category dashes to bullets or any other characters
- Display category description instead of “nothing found” page
- Link Attachment Image to Category
- Modify WordPress SQL Query to pull from within a category
- How can i insert term in a specific language of Polylang?
- How to retrieve more posts from a custom post type that are in the same category as the current post
- posts_nav_link(); picks up index.php instead of category.php as template
- Category name field strips HTML tags. How can I reverse this?
- Same base for category and post
- Get all media categories
- Custom taxonomy/category order
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- Add tag parameter to category.php
- Check IF category_description exists
- Get categories names as an array to use it in theme settings
- What Must to Display the “mysite.com/category” URL?
- How to display product with two condition, category and brand taxonomy
- List recent posts with link to first category
- How do I add a category to my post_type
- Link from navbar to categories
- WordPress showing wrong category name
- Add posts of a certain category to a page
- How can I filter posts by tag on the fly
- How to add a custom thumbnail size for a specific category?
- wp_nav_menu not appearing correctly on category page
- Post not found when filtered by category ID
- Categories Listing and Highlighting current category item
- Custom menu with categories and tags
- How to Show or Hidden Categories on page in WordPress?
- Show posts from a single category by default using wordpress.com
- category description not showing in my woocommerce
- Hide Some Categories in Post Editor
- Correct Hook/Filter to amend category choices on post edit page
- Should I select only the last child product category?
- Default URL for category dropdown select option
- Media Library Categories
- Exclude category from WP_Query args not working
- WordPress pagination based on category
- Make related posts display first in search result
- Display sub categories of a parent product in products – woocommerce [closed]
- A simple question regarding tags and categories
- Custom category for posts via XMLRPC
- Children categories not shown in dashboard
- Loops in category description
- Archives and category of authors
- Detecting top parent category fails on home page
- not empty categories don’t show in menu [closed]
- Show parent-child relationship for categories in the wordpress admin
- How to assign different categories to pages in wordpress?
- All post of child category not in top category
- How to add a tag above a category post that displays the category name in WordPress
- Woocommerce – Display product category of product in Orders page
- How to show video from wp option value?
- How to link ACF relationship field to the new Query block in Full Site Editing