Warning: DOMDocument::loadHTML(): Tag template invalid in Entity, line: 12 in /home/customer/www/thewirelessguy.co.uk/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 14 in /home/customer/www/thewirelessguy.co.uk/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 15 in /home/customer/www/thewirelessguy.co.uk/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag template invalid in Entity, line: 27 in /home/customer/www/thewirelessguy.co.uk/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 29 in /home/customer/www/thewirelessguy.co.uk/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 30 in /home/customer/www/thewirelessguy.co.uk/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
The example adds support for the Custom Post Type named ‘portfolio’. You would add this function to the functions.php in your theme or a plugin:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'rest_api_allowed_post_types', 'allow_my_post_types'); | |
function allow_my_post_types($allowed_post_types) { | |
$allowed_post_types[] = 'portfolio'; | |
return $allowed_post_types; | |
} | |
?> |