[wp-trac] [WordPress Trac] #61477: Inlude Template and template_lock to post types endpoint.
WordPress Trac
noreply at wordpress.org
Mon Oct 7 12:11:21 UTC 2024
#61477: Inlude Template and template_lock to post types endpoint.
--------------------------------------+-------------------------------
Reporter: jorgefilipecosta | Owner: jorgefilipecosta
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.6
Component: REST API | Version: 6.6
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+-------------------------------
Comment (by sarapalmerdev):
I have checked it.
{{{#!php
<?php
I added the following test code to a PHP file:
function myplugin_register_template() {
$post_type_object = get_post_type_object( 'page' );
$post_type_object->template = array(
array( 'core/image' ),
);
$post_type_object->template_lock = 'all';
}
add_action( 'init', 'myplugin_register_template' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61477#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list