Make WordPress Core


Ignore:
Timestamp:
09/30/2025 05:05:42 PM (4 months ago)
Author:
desrosj
Message:

Grouped backports for the 5.0 branch.

  • REST API: Increase the specificity of capability checks for collections when the edit context is in use.
  • Menus: Prevent HTML in menu item titles from being rendered unexpectedly.

Merges [60814], [60815], [60816] to the 5.0 branch.

Props andraganescu, desrosj, ehti, hurayraiit, iandunn, joehoyle, johnbillion, jorbin, mnelson4, noisysocks, peterwilsoncc, phillsav, rmccue, timothyblynjacobs, vortfu, westonruter , whyisjake, zieladam.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-includes/class-wp-customize-nav-menus.php

    r43481 r60836  
    159159            } elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) {
    160160                // Add a post type archive link.
     161                $title   = $post_type->labels->archives;
    161162                $items[] = array(
    162                     'id'         => $object . '-archive',
    163                     'title'      => $post_type->labels->archives,
    164                     'type'       => 'post_type_archive',
    165                     'type_label' => __( 'Post Type Archive' ),
    166                     'object'     => $object,
    167                     'url'        => get_post_type_archive_link( $object ),
     163                    'id'             => $object_name . '-archive',
     164                    'title'          => $title,
     165                    'original_title' => $title,
     166                    'type'           => 'post_type_archive',
     167                    'type_label'     => __( 'Post Type Archive' ),
     168                    'object'         => $object_name,
     169                    'url'            => get_post_type_archive_link( $object_name ),
    168170                );
    169171            }
     
    194196                    $post_title = sprintf( __( '#%d (no title)' ), $post->ID );
    195197                }
     198
     199                $title   = html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
    196200                $items[] = array(
    197                     'id'         => "post-{$post->ID}",
    198                     'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    199                     'type'       => 'post_type',
    200                     'type_label' => get_post_type_object( $post->post_type )->labels->singular_name,
    201                     'object'     => $post->post_type,
    202                     'object_id'  => intval( $post->ID ),
    203                     'url'        => get_permalink( intval( $post->ID ) ),
     201                    'id'             => "post-{$post->ID}",
     202                    'title'          => $title,
     203                    'original_title' => $title,
     204                    'type'           => 'post_type',
     205                    'type_label'     => get_post_type_object( $post->post_type )->labels->singular_name,
     206                    'object'         => $post->post_type,
     207                    'object_id'      => (int) $post->ID,
     208                    'url'            => get_permalink( (int) $post->ID ),
    204209                );
    205210            }
     
    222227
    223228            foreach ( $terms as $term ) {
     229                $title   = html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) );
    224230                $items[] = array(
    225                     'id'         => "term-{$term->term_id}",
    226                     'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    227                     'type'       => 'taxonomy',
    228                     'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
    229                     'object'     => $term->taxonomy,
    230                     'object_id'  => intval( $term->term_id ),
    231                     'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),
     231                    'id'             => "term-{$term->term_id}",
     232                    'title'          => $title,
     233                    'original_title' => $title,
     234                    'type'           => 'taxonomy',
     235                    'type_label'     => get_taxonomy( $term->taxonomy )->labels->singular_name,
     236                    'object'         => $term->taxonomy,
     237                    'object_id'      => (int) $term->term_id,
     238                    'url'            => get_term_link( (int) $term->term_id, $term->taxonomy ),
    232239                );
    233240            }
Note: See TracChangeset for help on using the changeset viewer.