Make WordPress Core


Ignore:
Timestamp:
09/30/2025 05:06:32 PM (6 months ago)
Author:
desrosj
Message:

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

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

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

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

    r39951 r60838  
    165165            } elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) {
    166166                // Add a post type archive link.
     167                $title   = $post_type->labels->archives;
    167168                $items[] = array(
    168                     'id'         => $object . '-archive',
    169                     'title'      => $post_type->labels->archives,
    170                     'type'       => 'post_type_archive',
    171                     'type_label' => __( 'Post Type Archive' ),
    172                     'object'     => $object,
    173                     'url'        => get_post_type_archive_link( $object ),
     169                    'id'             => $object_name . '-archive',
     170                    'title'          => $title,
     171                    'original_title' => $title,
     172                    'type'           => 'post_type_archive',
     173                    'type_label'     => __( 'Post Type Archive' ),
     174                    'object'         => $object_name,
     175                    'url'            => get_post_type_archive_link( $object_name ),
    174176                );
    175177            }
     
    200202                    $post_title = sprintf( __( '#%d (no title)' ), $post->ID );
    201203                }
     204
     205                $title   = html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
    202206                $items[] = array(
    203                     'id'         => "post-{$post->ID}",
    204                     'title'      => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    205                     'type'       => 'post_type',
    206                     'type_label' => get_post_type_object( $post->post_type )->labels->singular_name,
    207                     'object'     => $post->post_type,
    208                     'object_id'  => intval( $post->ID ),
    209                     'url'        => get_permalink( intval( $post->ID ) ),
     207                    'id'             => "post-{$post->ID}",
     208                    'title'          => $title,
     209                    'original_title' => $title,
     210                    'type'           => 'post_type',
     211                    'type_label'     => get_post_type_object( $post->post_type )->labels->singular_name,
     212                    'object'         => $post->post_type,
     213                    'object_id'      => (int) $post->ID,
     214                    'url'            => get_permalink( (int) $post->ID ),
    210215                );
    211216            }
     
    228233
    229234            foreach ( $terms as $term ) {
     235                $title   = html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) );
    230236                $items[] = array(
    231                     'id'         => "term-{$term->term_id}",
    232                     'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    233                     'type'       => 'taxonomy',
    234                     'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
    235                     'object'     => $term->taxonomy,
    236                     'object_id'  => intval( $term->term_id ),
    237                     'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),
     237                    'id'             => "term-{$term->term_id}",
     238                    'title'          => $title,
     239                    'original_title' => $title,
     240                    'type'           => 'taxonomy',
     241                    'type_label'     => get_taxonomy( $term->taxonomy )->labels->singular_name,
     242                    'object'         => $term->taxonomy,
     243                    'object_id'      => (int) $term->term_id,
     244                    'url'            => get_term_link( (int) $term->term_id, $term->taxonomy ),
    238245                );
    239246            }
Note: See TracChangeset for help on using the changeset viewer.