Make WordPress Core


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

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

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

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

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

    r44328 r60834  
    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                        }
     
    199201                                        $post_title = sprintf( __( '#%d (no title)' ), $post->ID );
    200202                                }
     203
     204                                $title   = html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
    201205                                $items[] = array(
    202                                         'id'         => "post-{$post->ID}",
    203                                         'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    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'  => intval( $post->ID ),
    208                                         'url'        => get_permalink( intval( $post->ID ) ),
     206                                        'id'             => "post-{$post->ID}",
     207                                        'title'          => $title,
     208                                        'original_title' => $title,
     209                                        'type'           => 'post_type',
     210                                        'type_label'     => get_post_type_object( $post->post_type )->labels->singular_name,
     211                                        'object'         => $post->post_type,
     212                                        'object_id'      => (int) $post->ID,
     213                                        'url'            => get_permalink( (int) $post->ID ),
    209214                                );
    210215                        }
     
    230235
    231236                        foreach ( $terms as $term ) {
     237                                $title   = html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) );
    232238                                $items[] = array(
    233                                         'id'         => "term-{$term->term_id}",
    234                                         'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    235                                         'type'       => 'taxonomy',
    236                                         'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
    237                                         'object'     => $term->taxonomy,
    238                                         'object_id'  => intval( $term->term_id ),
    239                                         'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),
     239                                        'id'             => "term-{$term->term_id}",
     240                                        'title'          => $title,
     241                                        'original_title' => $title,
     242                                        'type'           => 'taxonomy',
     243                                        'type_label'     => get_taxonomy( $term->taxonomy )->labels->singular_name,
     244                                        'object'         => $term->taxonomy,
     245                                        'object_id'      => (int) $term->term_id,
     246                                        'url'            => get_term_link( (int) $term->term_id, $term->taxonomy ),
    240247                                );
    241248                        }
Note: See TracChangeset for help on using the changeset viewer.