|  | @@ 277-291 (lines=15) @@ | 
                                                            
                                    | 274 |  | 	 * @param string     $controller     Optional, controller class for route. If not set "WP_REST_Posts_Controller" is | 
                                                            
                                    | 275 |  | 	 *                                   used. | 
                                                            
                                    | 276 |  | 	 */ | 
                                                            
                                    | 277 |  | 	public static function post_type_rest_support( $post_type_name, $rest_base = false, $controller = 'WP_REST_Posts_Controller' ) { | 
                                                            
                                    | 278 |  |  | 
                                                            
                                    | 279 |  | 		global $wp_post_types; | 
                                                            
                                    | 280 |  |  | 
                                                            
                                    | 281 |  | 		if ( isset( $wp_post_types[ $post_type_name ] ) ) { | 
                                                            
                                    | 282 |  | 			if ( ! $rest_base ) { | 
                                                            
                                    | 283 |  | 				$rest_base = $post_type_name; | 
                                                            
                                    | 284 |  | 			} | 
                                                            
                                    | 285 |  |  | 
                                                            
                                    | 286 |  | 			$wp_post_types[ $post_type_name ]->show_in_rest          = true; | 
                                                            
                                    | 287 |  | 			$wp_post_types[ $post_type_name ]->rest_base             = $rest_base; | 
                                                            
                                    | 288 |  | 			$wp_post_types[ $post_type_name ]->rest_controller_class = $controller; | 
                                                            
                                    | 289 |  | 		} | 
                                                            
                                    | 290 |  |  | 
                                                            
                                    | 291 |  | 	} | 
                                                            
                                    | 292 |  |  | 
                                                            
                                    | 293 |  | 	/** | 
                                                            
                                    | 294 |  | 	 * Add REST API support to an already registered taxonomy. | 
                                                                                
                                |  | @@ 303-317 (lines=15) @@ | 
                                                            
                                    | 300 |  | 	 * @param string     $controller    Optional, controller class for route. If not set "WP_REST_Terms_Controller" is | 
                                                            
                                    | 301 |  | 	 *                                  used. | 
                                                            
                                    | 302 |  | 	 */ | 
                                                            
                                    | 303 |  | 	public static function taxonomy_rest_support( $taxonomy_name, $rest_base = false, $controller = 'WP_REST_Terms_Controller' ) { | 
                                                            
                                    | 304 |  |  | 
                                                            
                                    | 305 |  | 		global $wp_taxonomies; | 
                                                            
                                    | 306 |  |  | 
                                                            
                                    | 307 |  | 		if ( isset( $wp_taxonomies[ $taxonomy_name ] ) ) { | 
                                                            
                                    | 308 |  | 			if ( ! $rest_base ) { | 
                                                            
                                    | 309 |  | 				$rest_base = $taxonomy_name; | 
                                                            
                                    | 310 |  | 			} | 
                                                            
                                    | 311 |  |  | 
                                                            
                                    | 312 |  | 			$wp_taxonomies[ $taxonomy_name ]->show_in_rest          = true; | 
                                                            
                                    | 313 |  | 			$wp_taxonomies[ $taxonomy_name ]->rest_base             = $rest_base; | 
                                                            
                                    | 314 |  | 			$wp_taxonomies[ $taxonomy_name ]->rest_controller_class = $controller; | 
                                                            
                                    | 315 |  | 		} | 
                                                            
                                    | 316 |  |  | 
                                                            
                                    | 317 |  | 	} | 
                                                            
                                    | 318 |  |  | 
                                                            
                                    | 319 |  | 	/** | 
                                                            
                                    | 320 |  | 	 * Check if a Pod supports extending core REST response. |