File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ private static function query_handler( $user_id ) {
368368 $ syndicate_tos = apply_filters ( 'micropub_syndicate-to ' , array (), $ user_id );
369369 $ resp = array ( 'syndicate-to ' => $ syndicate_tos );
370370 break ;
371+ case 'category ' :
372+ $ resp = array_merge (
373+ get_tags ( array ( 'fields ' => 'names ' ) ),
374+ get_terms ( array ( 'taxonomy ' => 'category ' , 'fields ' => 'names ' ) )
375+ );
376+ break ;
371377 case 'source ' :
372378 $ post_id = url_to_postid ( static ::$ input ['url ' ] );
373379 if ( ! $ post_id ) {
Original file line number Diff line number Diff line change @@ -293,6 +293,18 @@ function test_query_source() {
293293 $ this ->check ( 200 , self ::$ mf2 );
294294 }
295295
296+ function test_query_category () {
297+ $ _POST = self ::$ post ;
298+ $ post = $ this ->check_create ();
299+ $ _GET = array (
300+ 'q ' => 'category '
301+ );
302+ wp_set_post_tags ( $ post ->ID , 'Tag ' );
303+ wp_create_categories ( array ( 'Category ' ), $ post ->ID );
304+ $ this ->check ( 200 , array ( 'Tag ' , 'Category ' ) );
305+ }
306+
307+
296308 function test_query_source_with_properties () {
297309 $ _POST = self ::$ post ;
298310 $ post = $ this ->check_create ();
You can’t perform that action at this time.
0 commit comments