Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #12955, comment 76


Ignore:
Timestamp:
05/02/2018 08:06:20 PM (7 years ago)
Author:
MikeSchinkel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12955, comment 76

    initial v1  
    1212That said, the more I think about it the more I think this concern primarily applies to built-in post types and not to custom post types that are implemented for a specific plugin or specific site.  Those we should be able to extend without too much concern. 
    1313
    14 So consider the following proposal:  We added a private "lock" array to WP_Post that defaults to all the built-in post types and a method that allows checking it a post type is locked.  If a post type is not locked them the `get_post` filter would not reset to clean `WP_Post` but if it is locked it would trigger an error.
     14So consider the following proposal:  We added a private "lock" array to WP_Post that defaults to all the built-in post types and a method that allows checking it a post type is locked.  If a post type is not locked then the `get_post` filter would not reset to clean `WP_Post` but if it is locked it would trigger an error.
    1515
    1616Then we could also add a method that allows adding post types to the lock array so that plugins like WooCommerce could lock their post types when loading too.