Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    At the moment you’d need to follow the instructions for “Adding REST API Support To Existing Content Types” on the page you linked to.

    Thread Starter Volkmar Kantor

    (@volkmar-kantor)

    Hi,
    i am sorry. Didn’t see this code.

    The following code worked perfect (PHP7):

    
    add_action( 'init', function() {
    	global $wp_post_types;
     
    	$post_type_name = 'event';
    	if( isset( $wp_post_types[ $post_type_name ] ) ) {
    		$wp_post_types[$post_type_name]->show_in_rest = true;
    	}
    },25);
    
    • This reply was modified 6 years, 10 months ago by Volkmar Kantor. Reason: code-tag incorrect
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Option for activating REST-API’ is closed to new replies.