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
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Adding Field to Profile “Name”
- User Defined order on get_categories?
- Need to get specific data from array
- Categories Template Assistance
- Create an array from an array
- Problems with function on function.php
- Use template for posts with a particular category grandparent
- Must Use Plugin Causing Query Error
- Settings API – sanitize_callback is not called and it leads to an incorrect behavior
- How to convert objects into arrays
- Custom category code not showing all posts
- PHP get the first post separately from array returned by wpdb->get_results()
- how can i show only the parents in owl-carousel?
- How can I add multiple ‘tax_query’ arrays via a loop?
- How to use transient in this code for related post?
- Correct folder permissions?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Let Users Choose Post Categories
- Building a WordPress App
- Display most popular posts of category
- meaning of (array)function()
- Create menu locations for each category in wordpress
- get taxonomy thumbnail and use it as a variable in code
- 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
- Get html data with javascript to php array and store to wordpress database
- How do I create a numbered list with PHP? [closed]
- How to use array in function to get only value I want
- Warning: in_array() null given in PHP function
- register_setting & add_settings_error validation issues with multiple fields
- Foreach loop inside an array_merge
- Use get() method to grab all categories and output inside another method
- How to separate categories with commas?
- Getting posts to exclude from array
- Reading settings in the home page precisely home.php
- Show all tags within a category?
- Displaying list of posts in category page
- Alphabetically Ordered Category in WordPress
- how to make an array of post id’s in is_single
- How can I split my query result in 2 arrays?
- Loading Posts & Category with Ajax
- How to get current category
- array_rand not working correctly?
- Dynamically adding filters
- Order a WP_Query by meta value where the value is an array
- Show parent categories of the current category
- is user member of a group, show them categories [closed]
- Adding a ‘style=’ bit to image_send_to_editor output
- Get category id when SEO URL is turned on
- Repeat a function with 24hrs gap for n number of days
- Pagination at category doesnt work with same name of page
- display the months of a specific category
- Dropdown category field inside repeatable metabox
- Order users by random not working?
- Child-Theme Category View with modified permalinks (%category% removed)
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- How to move a post from one category to another
- Create category after theme setup and modify the default one
- WP post meta – for loop inside for loop
- Store custom field’s multiple values in one user meta key
- Make sticky post with FacetWP
- Displaying 3 Category Posts differently
- Trouble with checked() for array of multiple checkboxes
- How to list categories by page id in wordpress
- How to use foreach and if statement within array of arrays?
- WordPress using get_term to retreive slug not working as expected
- wordpress ajax return 0
- Showing the project type in HREF
- How do I display Category titles on a WP Page?
- Front end post submissions do not get submitted in the category
- problem with category menu, it doesn’t want to show link
- WP_Post is not from correct array
- Undefined index notice when using the $args parameter in add_settings_field()
- Saving category as insert post
- Trying to exclude posts from a category on the home page
- Adapting a php array to WordPress
- Showing Subcategory’s Name and Link Instead of Parent Category’s
- What is this mark for “? function()” [closed]
- How to combine array info [closed]
- on category page get name of category as a string
- WordPress categories not working throughout site
- Remove /category/ from category (archive) page URLs (without using a plugin)
- Get Products within Current Product Category
- get_body_params() is always empty in POST request
- Exclude Everywhere but Admin Area?
- Adding date and time to the same request