Thanks Michael for the tip. I finally got it. The solution is as follows:
$options[] = array(
"section" => "zzz",
"id" => HS_SHORTNAME . "_multicheckbox_inputs",
"title" => __( 'Multi-Checkbox', 'hs_textdomain' ),
"desc" => __( 'Some Description', 'hs_textdomain' ),
"type" => "multi-checkbox",
"std" => '',
"choices" => my_list_cats()
);
And in functions.php:
function my_list_cats() {
$cats = get_categories();
foreach($cats as $cat) {
$catsArray[] = __('' . $cat->cat_name . '','hs_textdomain') . "|" . $cat->category_nicename . "";
}
return $catsArray;
}
Thanks again!
Related Posts:
- Admin Options page. Save as Array
- How to array only one key from another array
- How to get the last category name of a child category?
- Output category list inside array
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- Finding and removing duplicates within WP Arrays
- Using multiple variables to assign categories to an array
- admin panel – How to remove “delete” button from category editing page
- How to filter specific element of an array in wordpress/php?
- wp_get_archive for category returning different URLs on different but similar sites
- !in_array doesnt recognize category
- Call global variable array() in woocommerce child/template
- Storing Array from returned database query and using the array in a new query
- Fatal Error relating to sessions.php
- Proper syntax or method for keeping url in modified isotope / category links
- Correct folder permissions?
- Filter Select results based on selection
- get_the_tags() not iterating through for/while loop, but will with foreach
- get a simple array of all of the term names that exist in all taxonomies
- Selectbox in admin panel function linking to CSS
- What is an equivalent of single_cat_title for getting the slug of the category?
- Populate dropdown with Child Pages based on Parent Page chosen
- Issue adding sub category programmatically
- How to use $query->set with post__in?
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- how do I get a specific post from a post with a subcategory in WP
- Sort custom meta column by other meta value
- WP grandchild categories in nested ul li
- Grab posts by multiple categories
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Reprinting tags with all attributes
- How to show single category archive
- Move category description below post list in blog
- How to pick the default selected value in wordpress dropdown?
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Get page that displays all children of taxonomy parent
- Whitelisting items from custom options page
- PHP Array Returning [object Object]. Tried existing answers results with no luck
- foreach loop still echoes array
- selected option if current category is the value
- get_template_part based upon post’s category
- running wp-cron.php using php not wget
- Exclude posts based on meta value
- how to save selected option in variable for rest api category filter
- Setting default category base on theme activation
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Hide subcategories (widget)
- Settings API callback function inserts html quotes from nowhere
- Alert Bar section within WP loop is displaying even though there are no posts
- Let Users Choose Post Categories
- Programmatically create page when saving custom post type post
- Different post styles depending on category
- Display category name only once inside loop
- Checking array against author id in loop
- Uploading files using the Settings API
- How to show only subcategories in parent category not parent category?
- Get URL Parameters from referer
- Saving plugin settings – ERROR: options page not found
- how to show only specific category for a template
- Redirect to another page using contact form 7? [closed]
- Building a WordPress App
- Alter required message using comment form api
- Dilemma of Populating all the categories in a drop down list
- Display most popular posts of category
- Advanced Custom Fields – display label and value only if value entered
- meaning of (array)function()
- Grouping posts by a custom meta value
- Create menu locations for each category in wordpress
- Creating sub-categories via php
- How can I open up my administrative panel to everyone?
- Define specific category name in PHP
- Edit the_category (); for a hierarchical display
- JSON REST API WordPress only showing first 10 categories
- Category title output before opening title tag
- wp_force_remove_style’ not found
- get taxonomy thumbnail and use it as a variable in code
- Include Parent Term in wp_list_categories
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How can I access string value in an array?
- How to use if statement in an array? [closed]
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Filtering a function’ output for a new continued function
- Get html data with javascript to php array and store to wordpress database
- Get all categories post is not in
- Get latest post from all categories except one
- How do I create a numbered list with PHP? [closed]
- Displaying posts based on category
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How do I remove a category from a wordpress loop>
- How to use array in function to get only value I want
- retain querystring values when savincustom options in admin
- Error while setting role
- Get Page ID from Backend
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- How to say if meta_value is greater than 0 in an array?
- How to use two meta_compare in an array?
- Warning: in_array() null given in PHP function
- how to save checkbox data for custom setting?
- register_setting & add_settings_error validation issues with multiple fields