Make WordPress Core


Ignore:
Timestamp:
09/30/2025 05:03:26 PM (7 months ago)
Author:
desrosj
Message:

Grouped backports for the 5.7 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.7 branch.

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

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

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

    r49108 r60829  
    191191            } elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) {
    192192                // Add a post type archive link.
     193                $title   = $post_type->labels->archives;
    193194                $items[] = array(
    194                     'id'         => $object . '-archive',
    195                     'title'      => $post_type->labels->archives,
    196                     'type'       => 'post_type_archive',
    197                     'type_label' => __( 'Post Type Archive' ),
    198                     'object'     => $object,
    199                     'url'        => get_post_type_archive_link( $object ),
     195                    'id'             => $object . '-archive',
     196                    'title'          => $title,
     197                    'original_title' => $title,
     198                    'type'           => 'post_type_archive',
     199                    'type_label'     => __( 'Post Type Archive' ),
     200                    'object'         => $object,
     201                    'url'            => get_post_type_archive_link( $object ),
    200202                );
    201203            }
     
    244246                }
    245247
     248                $title   = html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
    246249                $items[] = array(
    247                     'id'         => "post-{$post->ID}",
    248                     'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    249                     'type'       => 'post_type',
    250                     'type_label' => $post_type_label,
    251                     'object'     => $post->post_type,
    252                     'object_id'  => (int) $post->ID,
    253                     'url'        => get_permalink( (int) $post->ID ),
     250                    'id'             => "post-{$post->ID}",
     251                    'title'          => $title,
     252                    'original_title' => $title,
     253                    'type'           => 'post_type',
     254                    'type_label'     => $post_type_label,
     255                    'object'         => $post->post_type,
     256                    'object_id'      => (int) $post->ID,
     257                    'url'            => get_permalink( (int) $post->ID ),
    254258                );
    255259            }
     
    276280
    277281            foreach ( $terms as $term ) {
     282                $title   = html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) );
    278283                $items[] = array(
    279                     'id'         => "term-{$term->term_id}",
    280                     'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    281                     'type'       => 'taxonomy',
    282                     'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
    283                     'object'     => $term->taxonomy,
    284                     'object_id'  => (int) $term->term_id,
    285                     'url'        => get_term_link( (int) $term->term_id, $term->taxonomy ),
     284                    'id'             => "term-{$term->term_id}",
     285                    'title'          => $title,
     286                    'original_title' => $title,
     287                    'type'           => 'taxonomy',
     288                    'type_label'     => get_taxonomy( $term->taxonomy )->labels->singular_name,
     289                    'object'         => $term->taxonomy,
     290                    'object_id'      => (int) $term->term_id,
     291                    'url'            => get_term_link( (int) $term->term_id, $term->taxonomy ),
    286292                );
    287293            }
Note: See TracChangeset for help on using the changeset viewer.