Skip to content

Commit 5aeadfc

Browse files
committed
Include 4 6.8-branch commits
Commit list: e7f4ec069463a29c0b04686f577c80118fb1e40f c5bd4c18b44a668fa768e28817851bb55f6b319c 90b04c9acb684abab1e61c8d9e2e149943640618 95e0b633aca540fd3e50e690aae87d4ea8af3cc0 See #60
1 parent 0ed42b9 commit 5aeadfc

File tree

8 files changed

+85
-25
lines changed

8 files changed

+85
-25
lines changed

wp-admin/includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ function _fix_attachment_links( $post ) {
11581158
$url_id = (int) $url_match[2];
11591159
$rel_id = (int) $rel_match[1];
11601160

1161-
if ( ! $url_id || ! $rel_id || $url_id != $rel_id || ! str_contains( $url_match[0], $site_url ) ) {
1161+
if ( ! $url_id || ! $rel_id || $url_id !== $rel_id || ! str_contains( $url_match[0], $site_url ) ) {
11621162
continue;
11631163
}
11641164

wp-admin/js/tags.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ jQuery( function($) {
5555
$('a.tag-link-' + data.match(/tag_ID=(\d+)/)[1]).remove();
5656

5757
} else if ( '-1' == r ) {
58-
$('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'Sorry, you are not allowed to do that.' ) + '</p></div>');
58+
$('#ajax-response').empty().append('<div class="notice notice-error"><p>' + wp.i18n.__( 'Sorry, you are not allowed to do that.' ) + '</p></div>');
5959
tr.children().css('backgroundColor', '');
6060

6161
} else {
62-
$('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'An error occurred while processing your request. Please try again later.' ) + '</p></div>');
62+
$('#ajax-response').empty().append('<div class="notice notice-error"><p>' + wp.i18n.__( 'An error occurred while processing your request. Please try again later.' ) + '</p></div>');
6363
tr.children().css('backgroundColor', '');
6464
}
6565
});

wp-admin/js/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ themes.view.Installer = themes.view.Appearance.extend({
16651665
this.listenTo( this.collection, 'query:fail', function() {
16661666
$( 'body' ).removeClass( 'loading-content' );
16671667
$( '.theme-browser' ).find( 'div.error' ).remove();
1668-
$( '.theme-browser' ).find( 'div.themes' ).before( '<div class="error"><p>' + l10n.error + '</p></div>' );
1668+
$( '.theme-browser' ).find( 'div.themes' ).before( '<div class="notice notice-error"><p>' + l10n.error + '</p></div>' );
16691669
$( '.theme-browser .error .try-again' ).on( 'click', function( e ) {
16701670
e.preventDefault();
16711671
$( 'input.wp-filter-search' ).trigger( 'input' );

wp-admin/themes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283

284284
if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
285285
wp_admin_notice(
286-
__( 'Error:' ) . ' ' . $current_theme->errors()->get_error_message(),
286+
'<strong>' . __( 'Error:' ) . '</strong> ' . $current_theme->errors()->get_error_message(),
287287
array(
288288
'additional_classes' => array( 'error' ),
289289
)

wp-includes/general-template.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4613,6 +4613,7 @@ function paginate_links( $args = '' ) {
46134613
$link = add_query_arg( $add_args, $link );
46144614
}
46154615
$link .= $args['add_fragment'];
4616+
$link = get_option( 'permalink_structure' ) ? user_trailingslashit( $link, 'paged' ) : $link;
46164617

46174618
$page_links[] = sprintf(
46184619
'<a class="prev page-numbers" href="%s">%s</a>',
@@ -4645,6 +4646,7 @@ function paginate_links( $args = '' ) {
46454646
$link = add_query_arg( $add_args, $link );
46464647
}
46474648
$link .= $args['add_fragment'];
4649+
$link = get_option( 'permalink_structure' ) ? user_trailingslashit( $link, 'paged' ) : $link;
46484650

46494651
$page_links[] = sprintf(
46504652
'<a class="page-numbers" href="%s">%s</a>',
@@ -4669,6 +4671,7 @@ function paginate_links( $args = '' ) {
46694671
$link = add_query_arg( $add_args, $link );
46704672
}
46714673
$link .= $args['add_fragment'];
4674+
$link = get_option( 'permalink_structure' ) ? user_trailingslashit( $link, 'paged' ) : $link;
46724675

46734676
$page_links[] = sprintf(
46744677
'<a class="next page-numbers" href="%s">%s</a>',

wp-includes/js/plupload/handlers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function prepareMediaItemInit( fileObj ) {
204204

205205
// Generic error message.
206206
function wpQueueError( message ) {
207-
jQuery( '#media-upload-error' ).show().html( '<div class="error"><p>' + message + '</p></div>' );
207+
jQuery( '#media-upload-error' ).show().html( '<div class="notice notice-error"><p>' + message + '</p></div>' );
208208
}
209209

210210
// File-specific error messages.

wp-includes/js/plupload/handlers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php

Lines changed: 75 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,19 @@ public function prepare_item_for_response( $item, $request ) {
350350
}
351351
}
352352

353+
if ( rest_is_field_included( 'default_template_types', $fields ) && $this->is_same_theme( $theme, $current_theme ) ) {
354+
$default_template_types = array();
355+
foreach ( get_default_block_template_types() as $slug => $template_type ) {
356+
$template_type['slug'] = (string) $slug;
357+
$default_template_types[] = $template_type;
358+
}
359+
$data['default_template_types'] = $default_template_types;
360+
}
361+
362+
if ( rest_is_field_included( 'default_template_part_areas', $fields ) && $this->is_same_theme( $theme, $current_theme ) ) {
363+
$data['default_template_part_areas'] = get_allowed_block_template_part_areas();
364+
}
365+
353366
$data = $this->add_additional_fields_to_object( $data, $request );
354367

355368
// Wrap the data in a response object.
@@ -461,29 +474,29 @@ public function get_item_schema() {
461474
'title' => 'theme',
462475
'type' => 'object',
463476
'properties' => array(
464-
'stylesheet' => array(
477+
'stylesheet' => array(
465478
'description' => __( 'The theme\'s stylesheet. This uniquely identifies the theme.' ),
466479
'type' => 'string',
467480
'readonly' => true,
468481
),
469-
'stylesheet_uri' => array(
482+
'stylesheet_uri' => array(
470483
'description' => __( 'The uri for the theme\'s stylesheet directory.' ),
471484
'type' => 'string',
472485
'format' => 'uri',
473486
'readonly' => true,
474487
),
475-
'template' => array(
488+
'template' => array(
476489
'description' => __( 'The theme\'s template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet.' ),
477490
'type' => 'string',
478491
'readonly' => true,
479492
),
480-
'template_uri' => array(
493+
'template_uri' => array(
481494
'description' => __( 'The uri for the theme\'s template directory. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet directory.' ),
482495
'type' => 'string',
483496
'format' => 'uri',
484497
'readonly' => true,
485498
),
486-
'author' => array(
499+
'author' => array(
487500
'description' => __( 'The theme author.' ),
488501
'type' => 'object',
489502
'readonly' => true,
@@ -498,7 +511,7 @@ public function get_item_schema() {
498511
),
499512
),
500513
),
501-
'author_uri' => array(
514+
'author_uri' => array(
502515
'description' => __( 'The website of the theme author.' ),
503516
'type' => 'object',
504517
'readonly' => true,
@@ -515,7 +528,7 @@ public function get_item_schema() {
515528
),
516529
),
517530
),
518-
'description' => array(
531+
'description' => array(
519532
'description' => __( 'A description of the theme.' ),
520533
'type' => 'object',
521534
'readonly' => true,
@@ -530,12 +543,12 @@ public function get_item_schema() {
530543
),
531544
),
532545
),
533-
'is_block_theme' => array(
546+
'is_block_theme' => array(
534547
'description' => __( 'Whether the theme is a block-based theme.' ),
535548
'type' => 'boolean',
536549
'readonly' => true,
537550
),
538-
'name' => array(
551+
'name' => array(
539552
'description' => __( 'The name of the theme.' ),
540553
'type' => 'object',
541554
'readonly' => true,
@@ -550,23 +563,23 @@ public function get_item_schema() {
550563
),
551564
),
552565
),
553-
'requires_php' => array(
566+
'requires_php' => array(
554567
'description' => __( 'The minimum PHP version required for the theme to work.' ),
555568
'type' => 'string',
556569
'readonly' => true,
557570
),
558-
'requires_wp' => array(
571+
'requires_wp' => array(
559572
'description' => __( 'The minimum Retraceur version required for the theme to work.' ),
560573
'type' => 'string',
561574
'readonly' => true,
562575
),
563-
'screenshot' => array(
576+
'screenshot' => array(
564577
'description' => __( 'The theme\'s screenshot URL.' ),
565578
'type' => 'string',
566579
'format' => 'uri',
567580
'readonly' => true,
568581
),
569-
'tags' => array(
582+
'tags' => array(
570583
'description' => __( 'Tags indicating styles and features of the theme.' ),
571584
'type' => 'object',
572585
'readonly' => true,
@@ -584,18 +597,18 @@ public function get_item_schema() {
584597
),
585598
),
586599
),
587-
'textdomain' => array(
600+
'textdomain' => array(
588601
'description' => __( 'The theme\'s text domain.' ),
589602
'type' => 'string',
590603
'readonly' => true,
591604
),
592-
'theme_supports' => array(
605+
'theme_supports' => array(
593606
'description' => __( 'Features supported by this theme.' ),
594607
'type' => 'object',
595608
'readonly' => true,
596609
'properties' => array(),
597610
),
598-
'theme_uri' => array(
611+
'theme_uri' => array(
599612
'description' => __( 'The URI of the theme\'s webpage.' ),
600613
'type' => 'object',
601614
'readonly' => true,
@@ -612,16 +625,60 @@ public function get_item_schema() {
612625
),
613626
),
614627
),
615-
'version' => array(
628+
'version' => array(
616629
'description' => __( 'The theme\'s current version.' ),
617630
'type' => 'string',
618631
'readonly' => true,
619632
),
620-
'status' => array(
633+
'status' => array(
621634
'description' => __( 'A named status for the theme.' ),
622635
'type' => 'string',
623636
'enum' => array( 'inactive', 'active' ),
624637
),
638+
'default_template_types' => array(
639+
'description' => __( 'A list of default template types.' ),
640+
'type' => 'array',
641+
'readonly' => true,
642+
'items' => array(
643+
'type' => 'object',
644+
'properties' => array(
645+
'slug' => array(
646+
'type' => 'string',
647+
),
648+
'title' => array(
649+
'type' => 'string',
650+
),
651+
'description' => array(
652+
'type' => 'string',
653+
),
654+
),
655+
),
656+
),
657+
'default_template_part_areas' => array(
658+
'description' => __( 'A list of allowed area values for template parts.' ),
659+
'type' => 'array',
660+
'readonly' => true,
661+
'items' => array(
662+
'type' => 'object',
663+
'properties' => array(
664+
'area' => array(
665+
'type' => 'string',
666+
),
667+
'label' => array(
668+
'type' => 'string',
669+
),
670+
'description' => array(
671+
'type' => 'string',
672+
),
673+
'icon' => array(
674+
'type' => 'string',
675+
),
676+
'area_tag' => array(
677+
'type' => 'string',
678+
),
679+
),
680+
),
681+
),
625682
),
626683
);
627684

0 commit comments

Comments
 (0)