Make WordPress Core

Changeset 58184


Ignore:
Timestamp:
05/23/2024 01:39:09 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Editor: Add excerpt support to the wp_block post type.

The purpose is to enable using the excerpt as a description for user-created patterns on the Site Editor Pattern screens.

This commit backports the original PR from Gutenberg repository:

Reference: #55244: Patterns: Add descriptions to user-created patterns.

Follow-up to [44146], [44150], [50835], [56030].

Props poena, ntsekouras, krupalpanchal.
Fixes #61250.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r58175 r58184  
    329329            'supports'              => array(
    330330                'title',
     331                'excerpt',
    331332                'editor',
    332333                'revisions',
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r58065 r58184  
    38803880                            "required": false
    38813881                        },
     3882                        "excerpt": {
     3883                            "description": "The excerpt for the post.",
     3884                            "type": "object",
     3885                            "properties": {
     3886                                "raw": {
     3887                                    "description": "Excerpt for the post, as it exists in the database.",
     3888                                    "type": "string",
     3889                                    "context": [
     3890                                        "edit"
     3891                                    ]
     3892                                },
     3893                                "rendered": {
     3894                                    "description": "HTML excerpt for the post, transformed for display.",
     3895                                    "type": "string",
     3896                                    "context": [
     3897                                        "view",
     3898                                        "edit",
     3899                                        "embed"
     3900                                    ],
     3901                                    "readonly": true
     3902                                },
     3903                                "protected": {
     3904                                    "description": "Whether the excerpt is protected with a password.",
     3905                                    "type": "boolean",
     3906                                    "context": [
     3907                                        "view",
     3908                                        "edit",
     3909                                        "embed"
     3910                                    ],
     3911                                    "readonly": true
     3912                                }
     3913                            },
     3914                            "required": false
     3915                        },
    38823916                        "meta": {
    38833917                            "description": "Meta fields.",
     
    39403974                            "required": false
    39413975                        },
     3976                        "excerpt_length": {
     3977                            "description": "Override the default excerpt length.",
     3978                            "type": "integer",
     3979                            "required": false
     3980                        },
    39423981                        "password": {
    39433982                            "description": "The password for the post if it is password protected.",
     
    40504089                            "required": false
    40514090                        },
     4091                        "excerpt": {
     4092                            "description": "The excerpt for the post.",
     4093                            "type": "object",
     4094                            "properties": {
     4095                                "raw": {
     4096                                    "description": "Excerpt for the post, as it exists in the database.",
     4097                                    "type": "string",
     4098                                    "context": [
     4099                                        "edit"
     4100                                    ]
     4101                                },
     4102                                "rendered": {
     4103                                    "description": "HTML excerpt for the post, transformed for display.",
     4104                                    "type": "string",
     4105                                    "context": [
     4106                                        "view",
     4107                                        "edit",
     4108                                        "embed"
     4109                                    ],
     4110                                    "readonly": true
     4111                                },
     4112                                "protected": {
     4113                                    "description": "Whether the excerpt is protected with a password.",
     4114                                    "type": "boolean",
     4115                                    "context": [
     4116                                        "view",
     4117                                        "edit",
     4118                                        "embed"
     4119                                    ],
     4120                                    "readonly": true
     4121                                }
     4122                            },
     4123                            "required": false
     4124                        },
    40524125                        "meta": {
    40534126                            "description": "Meta fields.",
     
    43694442                                "protected": {
    43704443                                    "description": "Whether the content is protected with a password.",
     4444                                    "type": "boolean",
     4445                                    "context": [
     4446                                        "view",
     4447                                        "edit",
     4448                                        "embed"
     4449                                    ],
     4450                                    "readonly": true
     4451                                }
     4452                            },
     4453                            "required": false
     4454                        },
     4455                        "excerpt": {
     4456                            "description": "The excerpt for the post.",
     4457                            "type": "object",
     4458                            "properties": {
     4459                                "raw": {
     4460                                    "description": "Excerpt for the post, as it exists in the database.",
     4461                                    "type": "string",
     4462                                    "context": [
     4463                                        "edit"
     4464                                    ]
     4465                                },
     4466                                "rendered": {
     4467                                    "description": "HTML excerpt for the post, transformed for display.",
     4468                                    "type": "string",
     4469                                    "context": [
     4470                                        "view",
     4471                                        "edit",
     4472                                        "embed"
     4473                                    ],
     4474                                    "readonly": true
     4475                                },
     4476                                "protected": {
     4477                                    "description": "Whether the excerpt is protected with a password.",
    43714478                                    "type": "boolean",
    43724479                                    "context": [
Note: See TracChangeset for help on using the changeset viewer.