Adding Custom Endpoint in WordPress Rest API

Instead ID you should use cat_ID $data[$i][‘id’] = $category->cat_ID; get_categories() return list of category objects with: “term_id”: 7, “name”: “default”, “slug”: “default”, “term_group”: 0, “term_taxonomy_id”: 7, “taxonomy”: “category”, “description”: “”, “parent”: 0, “count”: 11, “filter”: “raw”, “cat_ID”: 7, “category_count”: 11, “category_description”: “”, “cat_name”: “Analiza”, “category_nicename”: “default”, “category_parent”: 0

Custom field in media library not saving, selected() function not adding “selected” to select list input type

As per outlined in the comments, by fixing a typo in my save function, and setting the third parameter in get_post_meta() to true, and false in selected() it worked liked a charm. Thanks everyone! Here’s the working code in case anyone is trying to add a select list custom field to their media manager: /* … Read more