Make WordPress Core


Ignore:
Timestamp:
10/20/2025 07:20:17 PM (11 months ago)
Author:
adamsilverstein
Message:

Editor: Introduce the PHP-related code for Notes.

Bring the PHP part of the new Notes feature into core for the 6.9 release. See related Gutenberg Issue: https://github.com/WordPress/gutenberg/issues/71826. These changes do not impact any user facing functionality, they simply prepare core for the JavaScript functionality that will come over in a separate sync.

Overview of changes:

  • Ensure Notes are not included in comment counts
  • Enable the note type (REST API)
  • Adjust capabilities so edit_post cap implies ability to edit notes
  • Enable empty and duplicate notes for resolve/re-open actions
  • Add control over notes with post type supports check
  • Register new note resolution status meta

Props: ristojovanovic, adamsilverstein, jeffpaul, wildworks, mamaduka, swissspidy, timothyblynjacobs, kadamwhite.
Fixes #64096.

File:
1 edited

Legend:

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

    r60906 r60987  
    3838                        'query_var'             => false,
    3939                        'delete_with_user'      => true,
    40                         'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
     40                        'supports'              => array(
     41                                'title',
     42                                'editor' => array( 'notes' => true ),
     43                                'author',
     44                                'thumbnail',
     45                                'excerpt',
     46                                'trackbacks',
     47                                'custom-fields',
     48                                'comments',
     49                                'revisions',
     50                                'post-formats',
     51                        ),
    4152                        'show_in_rest'          => true,
    4253                        'rest_base'             => 'posts',
     
    6374                        'query_var'             => false,
    6475                        'delete_with_user'      => true,
    65                         'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
     76                        'supports'              => array(
     77                                'title',
     78                                'editor' => array( 'notes' => true ),
     79                                'author',
     80                                'thumbnail',
     81                                'page-attributes',
     82                                'custom-fields',
     83                                'comments',
     84                                'revisions',
     85                        ),
    6686                        'show_in_rest'          => true,
    6787                        'rest_base'             => 'pages',
     
    23302350        return ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) );
    23312351}
    2332 
    23332352/**
    23342353 * Retrieves a list of post type names that support a specific feature.
Note: See TracChangeset for help on using the changeset viewer.