Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #45250, comment 3


Ignore:
Timestamp:
11/01/2018 12:32:04 PM (8 years ago)
Author:
Chouby
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #45250, comment 3

    initial v1  
    99Now, filtering the REST response would work for the fields such as `menu_order` as you tested it, but it would not work for the title, content and excerpt. That means that Gutenberg/WP 5.0 introduces some inconsistent behavior. Some fields need to be filtered in the REST response and some other using the global `$post` variable (or the filters `default_content`, `default_excerpt` and `default_title` which in fact have always and are still just an indirect way to modify only 3 properties of the global variable).
    1010
    11 Is there a way to know if the REST request is coming from the blocks editor and from anywhere outside?
     11Is there a way to know if the REST request is coming from the blocks editor and not from anywhere outside?