Changeset 46088
- Timestamp:
- 09/10/2019 07:22:07 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-custom-background.php
r45932 r46088 585 585 exit; 586 586 } 587 587 588 $attachment_id = absint( $_POST['attachment_id'] ); 588 /** This filter is documented in wp-admin/includes/media.php */ 589 589 590 $sizes = array_keys( 591 /** This filter is documented in wp-admin/includes/media.php */ 590 592 apply_filters( 591 593 'image_size_names_choose', … … 598 600 ) 599 601 ); 600 $size = 'thumbnail'; 602 603 $size = 'thumbnail'; 601 604 if ( in_array( $_POST['size'], $sizes ) ) { 602 605 $size = esc_attr( $_POST['size'] ); … … 604 607 605 608 update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) ); 609 606 610 $url = wp_get_attachment_image_src( $attachment_id, $size ); 607 611 $thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' ); -
trunk/src/wp-admin/includes/class-walker-category-checklist.php
r42343 r46088 96 96 } 97 97 98 /** This filter is documented in wp-includes/category-template.php */99 98 $output .= "\n" . '<li' . $class . '>' . 100 99 '<div class="' . $inner_class . '" data-term-id=' . $category->term_id . 101 100 ' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' . 101 /** This filter is documented in wp-includes/category-template.php */ 102 102 esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>'; 103 103 } else { 104 /** This filter is documented in wp-includes/category-template.php */105 104 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . 106 105 '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' . 107 106 checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . 108 107 disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . 108 /** This filter is documented in wp-includes/category-template.php */ 109 109 esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>'; 110 110 } -
trunk/src/wp-admin/includes/template.php
r46083 r46088 310 310 $title = esc_textarea( trim( $post->post_title ) ); 311 311 312 /** This filter is documented in wp-admin/edit-tag-form.php */313 312 echo ' 314 313 <div class="hidden" id="inline_' . $post->ID . '"> -
trunk/src/wp-content/themes/twentyeleven/author.php
r45932 r46088 60 60 * @param int The height and width avatar dimension in pixels. Default 60. 61 61 */ 62 echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); 62 $author_bio_avatar_size = apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ); 63 echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ); 63 64 ?> 64 65 </div><!-- #author-avatar --> -
trunk/src/wp-content/themes/twentyeleven/content-single.php
r45932 r46088 67 67 <?php 68 68 /** This filter is documented in author.php */ 69 echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); 69 $author_bio_avatar_size = apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ); 70 echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ); 70 71 ?> 71 72 </div><!-- #author-avatar --> -
trunk/src/wp-content/themes/twentyten/author.php
r45932 r46088 48 48 * @param int The height and width avatar dimensions in pixels. Default 60. 49 49 */ 50 echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); 50 $author_bio_avatar_size = apply_filters( 'twentyten_author_bio_avatar_size', 60 ); 51 echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ); 51 52 ?> 52 53 </div><!-- #author-avatar --> -
trunk/src/wp-content/themes/twentyten/loop-single.php
r45932 r46088 51 51 <?php 52 52 /** This filter is documented in author.php */ 53 echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); 53 $author_bio_avatar_size = apply_filters( 'twentyten_author_bio_avatar_size', 60 ); 54 echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ); 54 55 ?> 55 56 </div><!-- #author-avatar --> -
trunk/src/wp-includes/class-walker-category.php
r45932 r46088 98 98 public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { 99 99 /** This filter is documented in wp-includes/category-template.php */ 100 $cat_name = apply_filters( 101 'list_cats', 102 esc_attr( $category->name ), 103 $category 104 ); 100 $cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), $category ); 105 101 106 102 // Don't generate an element if the category name is empty. -
trunk/src/wp-includes/class-wp-image-editor-imagick.php
r45932 r46088 666 666 chmod( $filename, $perms ); 667 667 668 /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */669 668 return array( 670 669 'path' => $filename, 670 /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */ 671 671 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 672 672 'width' => $this->size['width'], -
trunk/src/wp-includes/class.wp-styles.php
r45590 r46088 200 200 $title = isset( $obj->extra['title'] ) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : ''; 201 201 202 $tag = "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n"; 203 202 204 /** 203 205 * Filters the HTML link tag of an enqueued style. … … 212 214 * @param string $media The stylesheet's media attribute. 213 215 */ 214 $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href, $media );216 $tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media ); 215 217 216 218 if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) { … … 222 224 } 223 225 226 $rtl_tag = "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n"; 224 227 /** This filter is documented in wp-includes/class.wp-styles.php */ 225 $rtl_tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle, $rtl_href, $media );228 $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media ); 226 229 227 230 if ( $obj->extra['rtl'] === 'replace' ) { -
trunk/src/wp-includes/comment-template.php
r45932 r46088 2275 2275 $html_req = ( $req ? " required='required'" : '' ); 2276 2276 $html5 = 'html5' === $args['format']; 2277 $fields = array( 2278 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 2279 '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>', 2280 'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . 2281 '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $html_req . ' /></p>', 2282 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' . 2283 '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>', 2277 2278 $fields = array( 2279 'author' => sprintf( 2280 '<p class="comment-form-author">%s %s</p>', 2281 sprintf( 2282 '<label for="author">%s%s</label>', 2283 __( 'Name' ), 2284 ( $req ? ' <span class="required">*</span>' : '' ) 2285 ), 2286 sprintf( 2287 '<input id="author" name="author" type="text" value="%s" size="30" maxlength="245"%s />', 2288 esc_attr( $commenter['comment_author'] ), 2289 $html_req 2290 ) 2291 ), 2292 'email' => sprintf( 2293 '<p class="comment-form-email">%s %s</p>', 2294 sprintf( 2295 '<label for="email">%s%s</label>', 2296 __( 'Email' ), 2297 ( $req ? ' <span class="required">*</span>' : '' ) 2298 ), 2299 sprintf( 2300 '<input id="email" name="email" %s value="%s" size="30" maxlength="100" aria-describedby="email-notes"%s />', 2301 ( $html5 ? 'type="email"' : 'type="text"' ), 2302 esc_attr( $commenter['comment_author_email'] ), 2303 $html_req 2304 ) 2305 ), 2306 'url' => sprintf( 2307 '<p class="comment-form-url">%s %s</p>', 2308 sprintf( 2309 '<label for="url">%s</label>', 2310 __( 'Website' ) 2311 ), 2312 sprintf( 2313 '<input id="url" name="url" %s value="%s" size="30" maxlength="200" />', 2314 ( $html5 ? 'type="url"' : 'type="text"' ), 2315 esc_attr( $commenter['comment_author_url'] ) 2316 ) 2317 ), 2284 2318 ); 2285 2319 2286 2320 if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) { 2287 $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"'; 2288 $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' . 2289 '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>'; 2321 $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"'; 2322 2323 $fields['cookies'] = sprintf( 2324 '<p class="comment-form-cookies-consent">%s %s</p>', 2325 sprintf( 2326 '<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"%s />', 2327 $consent 2328 ), 2329 sprintf( 2330 '<label for="wp-comment-cookies-consent">%s</label>', 2331 __( 'Save my name, email, and website in this browser for the next time I comment.' ) 2332 ) 2333 ); 2290 2334 2291 2335 // Ensure that the passed fields include cookies consent. … … 2308 2352 * @param string[] $fields Array of the default comment fields. 2309 2353 */ 2310 $fields = apply_filters( 'comment_form_default_fields', $fields ); 2354 $fields = apply_filters( 'comment_form_default_fields', $fields ); 2355 2311 2356 $defaults = array( 2312 2357 'fields' => $fields, 2313 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p>', 2314 /** This filter is documented in wp-includes/link-template.php */ 2315 'must_log_in' => '<p class="must-log-in">' . sprintf( 2316 /* translators: %s: Login URL. */ 2317 __( 'You must be <a href="%s">logged in</a> to post a comment.' ), 2318 wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) 2319 ) . '</p>', 2320 /** This filter is documented in wp-includes/link-template.php */ 2321 'logged_in_as' => '<p class="logged-in-as">' . sprintf( 2322 /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */ 2323 __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ), 2324 get_edit_user_link(), 2325 /* translators: %s: User name. */ 2326 esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), 2327 $user_identity, 2328 wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) 2329 ) . '</p>', 2330 'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>' . ( $req ? $required_text : '' ) . '</p>', 2358 'comment_field' => sprintf( 2359 '<p class="comment-form-comment">%s %s</p>', 2360 sprintf( 2361 '<label for="comment">%s</label>', 2362 _x( 'Comment', 'noun' ) 2363 ), 2364 '<textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea>' 2365 ), 2366 'must_log_in' => sprintf( 2367 '<p class="must-log-in">%s</p>', 2368 sprintf( 2369 /* translators: %s: Login URL. */ 2370 __( 'You must be <a href="%s">logged in</a> to post a comment.' ), 2371 /** This filter is documented in wp-includes/link-template.php */ 2372 wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) 2373 ) 2374 ), 2375 'logged_in_as' => sprintf( 2376 '<p class="logged-in-as">%s</p>', 2377 sprintf( 2378 /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */ 2379 __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ), 2380 get_edit_user_link(), 2381 /* translators: %s: User name. */ 2382 esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), 2383 $user_identity, 2384 /** This filter is documented in wp-includes/link-template.php */ 2385 wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) 2386 ) 2387 ), 2388 'comment_notes_before' => sprintf( 2389 '<p class="comment-notes">%s%s</p>', 2390 sprintf( 2391 '<span id="email-notes">%s</span>', 2392 __( 'Your email address will not be published.' ) 2393 ), 2394 ( $req ? $required_text : '' ) 2395 ), 2331 2396 'comment_notes_after' => '', 2332 2397 'action' => site_url( '/wp-comments-post.php' ), … … 2386 2451 2387 2452 if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) : 2453 2388 2454 echo $args['must_log_in']; 2389 2455 /** … … 2393 2459 */ 2394 2460 do_action( 'comment_form_must_log_in_after' ); 2461 2395 2462 else : 2396 ?> 2397 <form action="<?php echo esc_url( $args['action'] ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>> 2398 <?php 2463 2464 printf( 2465 '<form action="%s" method="post" id="%s" class="%s"%s>', 2466 esc_url( $args['action'] ), 2467 esc_attr( $args['id_form'] ), 2468 esc_attr( $args['class_form'] ), 2469 ( $html5 ? ' novalidate' : '' ) 2470 ); 2471 2472 /** 2473 * Fires at the top of the comment form, inside the form tag. 2474 * 2475 * @since 3.0.0 2476 */ 2477 do_action( 'comment_form_top' ); 2478 2479 if ( is_user_logged_in() ) : 2480 2399 2481 /** 2400 * Fi res at the top of the comment form, inside the form tag.2482 * Filters the 'logged in' message for the comment form for display. 2401 2483 * 2402 2484 * @since 3.0.0 2485 * 2486 * @param string $args_logged_in The logged-in-as HTML-formatted message. 2487 * @param array $commenter An array containing the comment author's 2488 * username, email, and URL. 2489 * @param string $user_identity If the commenter is a registered user, 2490 * the display name, blank otherwise. 2403 2491 */ 2404 do_action( 'comment_form_top' ); 2405 2406 if ( is_user_logged_in() ) : 2492 echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); 2493 2494 /** 2495 * Fires after the is_user_logged_in() check in the comment form. 2496 * 2497 * @since 3.0.0 2498 * 2499 * @param array $commenter An array containing the comment author's 2500 * username, email, and URL. 2501 * @param string $user_identity If the commenter is a registered user, 2502 * the display name, blank otherwise. 2503 */ 2504 do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); 2505 2506 else : 2507 2508 echo $args['comment_notes_before']; 2509 2510 endif; 2511 2512 // Prepare an array of all fields, including the textarea 2513 $comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields']; 2514 2515 /** 2516 * Filters the comment form fields, including the textarea. 2517 * 2518 * @since 4.4.0 2519 * 2520 * @param array $comment_fields The comment fields. 2521 */ 2522 $comment_fields = apply_filters( 'comment_form_fields', $comment_fields ); 2523 2524 // Get an array of field names, excluding the textarea 2525 $comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) ); 2526 2527 // Get the first and the last field name, excluding the textarea 2528 $first_field = reset( $comment_field_keys ); 2529 $last_field = end( $comment_field_keys ); 2530 2531 foreach ( $comment_fields as $name => $field ) { 2532 2533 if ( 'comment' === $name ) { 2534 2407 2535 /** 2408 * Filters the 'logged in' message for the comment formfor display.2536 * Filters the content of the comment textarea field for display. 2409 2537 * 2410 2538 * @since 3.0.0 2411 2539 * 2412 * @param string $args_logged_in The logged-in-as HTML-formatted message. 2413 * @param array $commenter An array containing the comment author's 2414 * username, email, and URL. 2415 * @param string $user_identity If the commenter is a registered user, 2416 * the display name, blank otherwise. 2540 * @param string $args_comment_field The content of the comment textarea field. 2417 2541 */ 2418 echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); 2542 echo apply_filters( 'comment_form_field_comment', $field ); 2543 2544 echo $args['comment_notes_after']; 2545 2546 } elseif ( ! is_user_logged_in() ) { 2547 2548 if ( $first_field === $name ) { 2549 /** 2550 * Fires before the comment fields in the comment form, excluding the textarea. 2551 * 2552 * @since 3.0.0 2553 */ 2554 do_action( 'comment_form_before_fields' ); 2555 } 2419 2556 2420 2557 /** 2421 * Fires after the is_user_logged_in() check in the comment form. 2558 * Filters a comment form field for display. 2559 * 2560 * The dynamic portion of the filter hook, `$name`, refers to the name 2561 * of the comment form field. Such as 'author', 'email', or 'url'. 2422 2562 * 2423 2563 * @since 3.0.0 2424 2564 * 2425 * @param array $commenter An array containing the comment author's 2426 * username, email, and URL. 2427 * @param string $user_identity If the commenter is a registered user, 2428 * the display name, blank otherwise. 2565 * @param string $field The HTML-formatted output of the comment form field. 2429 2566 */ 2430 do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); 2431 2432 else : 2433 2434 echo $args['comment_notes_before']; 2435 2436 endif; 2437 2438 // Prepare an array of all fields, including the textarea 2439 $comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields']; 2440 2441 /** 2442 * Filters the comment form fields, including the textarea. 2443 * 2444 * @since 4.4.0 2445 * 2446 * @param array $comment_fields The comment fields. 2447 */ 2448 $comment_fields = apply_filters( 'comment_form_fields', $comment_fields ); 2449 2450 // Get an array of field names, excluding the textarea 2451 $comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) ); 2452 2453 // Get the first and the last field name, excluding the textarea 2454 $first_field = reset( $comment_field_keys ); 2455 $last_field = end( $comment_field_keys ); 2456 2457 foreach ( $comment_fields as $name => $field ) { 2458 2459 if ( 'comment' === $name ) { 2460 2567 echo apply_filters( "comment_form_field_{$name}", $field ) . "\n"; 2568 2569 if ( $last_field === $name ) { 2461 2570 /** 2462 * Fi lters the content of the comment textarea field for display.2571 * Fires after the comment fields in the comment form, excluding the textarea. 2463 2572 * 2464 2573 * @since 3.0.0 2465 *2466 * @param string $args_comment_field The content of the comment textarea field.2467 2574 */ 2468 echo apply_filters( 'comment_form_field_comment', $field ); 2469 2470 echo $args['comment_notes_after']; 2471 2472 } elseif ( ! is_user_logged_in() ) { 2473 2474 if ( $first_field === $name ) { 2475 /** 2476 * Fires before the comment fields in the comment form, excluding the textarea. 2477 * 2478 * @since 3.0.0 2479 */ 2480 do_action( 'comment_form_before_fields' ); 2481 } 2482 2483 /** 2484 * Filters a comment form field for display. 2485 * 2486 * The dynamic portion of the filter hook, `$name`, refers to the name 2487 * of the comment form field. Such as 'author', 'email', or 'url'. 2488 * 2489 * @since 3.0.0 2490 * 2491 * @param string $field The HTML-formatted output of the comment form field. 2492 */ 2493 echo apply_filters( "comment_form_field_{$name}", $field ) . "\n"; 2494 2495 if ( $last_field === $name ) { 2496 /** 2497 * Fires after the comment fields in the comment form, excluding the textarea. 2498 * 2499 * @since 3.0.0 2500 */ 2501 do_action( 'comment_form_after_fields' ); 2502 } 2575 do_action( 'comment_form_after_fields' ); 2503 2576 } 2504 2577 } 2505 2506 $submit_button = sprintf( 2507 $args['submit_button'], 2508 esc_attr( $args['name_submit'] ), 2509 esc_attr( $args['id_submit'] ), 2510 esc_attr( $args['class_submit'] ), 2511 esc_attr( $args['label_submit'] ) 2512 ); 2513 2514 /** 2515 * Filters the submit button for the comment form to display. 2516 * 2517 * @since 4.2.0 2518 * 2519 * @param string $submit_button HTML markup for the submit button. 2520 * @param array $args Arguments passed to comment_form(). 2521 */ 2522 $submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args ); 2523 2524 $submit_field = sprintf( 2525 $args['submit_field'], 2526 $submit_button, 2527 get_comment_id_fields( $post_id ) 2528 ); 2529 2530 /** 2531 * Filters the submit field for the comment form to display. 2532 * 2533 * The submit field includes the submit button, hidden fields for the 2534 * comment form, and any wrapper markup. 2535 * 2536 * @since 4.2.0 2537 * 2538 * @param string $submit_field HTML markup for the submit field. 2539 * @param array $args Arguments passed to comment_form(). 2540 */ 2541 echo apply_filters( 'comment_form_submit_field', $submit_field, $args ); 2542 2543 /** 2544 * Fires at the bottom of the comment form, inside the closing </form> tag. 2545 * 2546 * @since 1.5.0 2547 * 2548 * @param int $post_id The post ID. 2549 */ 2550 do_action( 'comment_form', $post_id ); 2551 ?> 2552 </form> 2553 <?php endif; ?> 2578 } 2579 2580 $submit_button = sprintf( 2581 $args['submit_button'], 2582 esc_attr( $args['name_submit'] ), 2583 esc_attr( $args['id_submit'] ), 2584 esc_attr( $args['class_submit'] ), 2585 esc_attr( $args['label_submit'] ) 2586 ); 2587 2588 /** 2589 * Filters the submit button for the comment form to display. 2590 * 2591 * @since 4.2.0 2592 * 2593 * @param string $submit_button HTML markup for the submit button. 2594 * @param array $args Arguments passed to comment_form(). 2595 */ 2596 $submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args ); 2597 2598 $submit_field = sprintf( 2599 $args['submit_field'], 2600 $submit_button, 2601 get_comment_id_fields( $post_id ) 2602 ); 2603 2604 /** 2605 * Filters the submit field for the comment form to display. 2606 * 2607 * The submit field includes the submit button, hidden fields for the 2608 * comment form, and any wrapper markup. 2609 * 2610 * @since 4.2.0 2611 * 2612 * @param string $submit_field HTML markup for the submit field. 2613 * @param array $args Arguments passed to comment_form(). 2614 */ 2615 echo apply_filters( 'comment_form_submit_field', $submit_field, $args ); 2616 2617 /** 2618 * Fires at the bottom of the comment form, inside the closing </form> tag. 2619 * 2620 * @since 1.5.0 2621 * 2622 * @param int $post_id The post ID. 2623 */ 2624 do_action( 'comment_form', $post_id ); 2625 2626 echo '</form>'; 2627 2628 endif; 2629 ?> 2554 2630 </div><!-- #respond --> 2555 2631 <?php -
trunk/src/wp-includes/general-template.php
r45932 r46088 4043 4043 $mid_size = 2; 4044 4044 } 4045 4045 4046 $add_args = $args['add_args']; 4046 4047 $r = ''; … … 4056 4057 $link .= $args['add_fragment']; 4057 4058 4058 /** 4059 * Filters the paginated links for the given archive pages. 4060 * 4061 * @since 3.0.0 4062 * 4063 * @param string $link The paginated link URL. 4064 */ 4065 $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['prev_text'] . '</a>'; 4059 $page_links[] = sprintf( 4060 '<a class="prev page-numbers" href="%s">%s</a>', 4061 /** 4062 * Filters the paginated links for the given archive pages. 4063 * 4064 * @since 3.0.0 4065 * 4066 * @param string $link The paginated link URL. 4067 */ 4068 esc_url( apply_filters( 'paginate_links', $link ) ), 4069 $args['prev_text'] 4070 ); 4066 4071 endif; 4072 4067 4073 for ( $n = 1; $n <= $total; $n++ ) : 4068 4074 if ( $n == $current ) : 4069 $page_links[] = "<span aria-current='" . esc_attr( $args['aria_current'] ) . "' class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</span>'; 4075 $page_links[] = sprintf( 4076 '<span aria-current="%s" class="page-numbers current">%s</span>', 4077 esc_attr( $args['aria_current'] ), 4078 $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] 4079 ); 4070 4080 $dots = true; 4071 4081 else : … … 4078 4088 $link .= $args['add_fragment']; 4079 4089 4080 /** This filter is documented in wp-includes/general-template.php */ 4081 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</a>'; 4090 $page_links[] = sprintf( 4091 '<a class="page-numbers" href="%s">%s</a>', 4092 /** This filter is documented in wp-includes/general-template.php */ 4093 esc_url( apply_filters( 'paginate_links', $link ) ), 4094 $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] 4095 ); 4082 4096 $dots = true; 4083 4097 elseif ( $dots && ! $args['show_all'] ) : … … 4087 4101 endif; 4088 4102 endfor; 4103 4089 4104 if ( $args['prev_next'] && $current && $current < $total ) : 4090 4105 $link = str_replace( '%_%', $args['format'], $args['base'] ); … … 4095 4110 $link .= $args['add_fragment']; 4096 4111 4097 /** This filter is documented in wp-includes/general-template.php */ 4098 $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $args['next_text'] . '</a>'; 4112 $page_links[] = sprintf( 4113 '<a class="next page-numbers" href="%s">%s</a>', 4114 /** This filter is documented in wp-includes/general-template.php */ 4115 esc_url( apply_filters( 'paginate_links', $link ) ), 4116 $args['next_text'] 4117 ); 4099 4118 endif; 4119 4100 4120 switch ( $args['type'] ) { 4101 4121 case 'array': … … 4112 4132 break; 4113 4133 } 4134 4114 4135 return $r; 4115 4136 } … … 4323 4344 */ 4324 4345 function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { 4325 // For backward compatibility 4346 // For backward compatibility. 4326 4347 $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file; 4327 4348 4328 4349 if ( wp_styles()->query( $handle ) ) { 4329 if ( $force_echo || did_action( 'wp_print_styles' ) ) { // we already printed the style queue. Print this one immediately 4350 if ( $force_echo || did_action( 'wp_print_styles' ) ) { 4351 // We already printed the style queue. Print this one immediately. 4330 4352 wp_print_styles( $handle ); 4331 } else { // Add to style queue 4353 } else { 4354 // Add to style queue. 4332 4355 wp_enqueue_style( $handle ); 4333 4356 } 4334 4357 return; 4335 4358 } 4359 4360 $stylesheet_link = sprintf( 4361 "<link rel='stylesheet' href='%s' type='text/css' />\n", 4362 esc_url( wp_admin_css_uri( $file ) ) 4363 ); 4336 4364 4337 4365 /** … … 4346 4374 * relative to wp-admin/. Defaults to 'wp-admin'. 4347 4375 */ 4348 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file );4376 echo apply_filters( 'wp_admin_css', $stylesheet_link, $file ); 4349 4377 4350 4378 if ( function_exists( 'is_rtl' ) && is_rtl() ) { 4379 $rtl_stylesheet_link = sprintf( 4380 "<link rel='stylesheet' href='%s' type='text/css' />\n", 4381 esc_url( wp_admin_css_uri( "$file-rtl" ) ) 4382 ); 4383 4351 4384 /** This filter is documented in wp-includes/general-template.php */ 4352 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );4385 echo apply_filters( 'wp_admin_css', $rtl_stylesheet_link, "$file-rtl" ); 4353 4386 } 4354 4387 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
r45811 r46088 359 359 } 360 360 361 /** 362 * This filter is documented in wp-admin/post.php. 363 */ 361 /** This filter is documented in wp-admin/post.php */ 364 362 do_action( 'wp_creating_autosave', $new_autosave ); 365 363 -
trunk/src/wp-includes/user.php
r45932 r46088 2504 2504 } else { 2505 2505 /** This filter is documented in wp-includes/user.php */ 2506 $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array()) );2507 if ( in_array( strtolower( $sanitized_user_login ), $illegal_user_logins) ) {2506 $illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() ); 2507 if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ) ) ) { 2508 2508 $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) ); 2509 2509 } -
trunk/tests/phpunit/tests/general/paginateLinks.php
r43571 r46088 17 17 18 18 $expected = <<<EXPECTED 19 <span aria-current= 'page' class='page-numbers current'>1</span>20 <a class= 'page-numbers' href='$page2'>2</a>21 <a class= 'page-numbers' href='$page3'>3</a>19 <span aria-current="page" class="page-numbers current">1</span> 20 <a class="page-numbers" href="$page2">2</a> 21 <a class="page-numbers" href="$page3">3</a> 22 22 <span class="page-numbers dots">…</span> 23 <a class= 'page-numbers' href='$page50'>50</a>23 <a class="page-numbers" href="$page50">50</a> 24 24 <a class="next page-numbers" href="$page2">Next »</a> 25 25 EXPECTED; … … 35 35 36 36 $expected = <<<EXPECTED 37 <span aria-current= 'page' class='page-numbers current'>1</span>38 <a class= 'page-numbers' href='$page2'>2</a>39 <a class= 'page-numbers' href='$page3'>3</a>37 <span aria-current="page" class="page-numbers current">1</span> 38 <a class="page-numbers" href="$page2">2</a> 39 <a class="page-numbers" href="$page3">3</a> 40 40 <span class="page-numbers dots">…</span> 41 <a class= 'page-numbers' href='$page50'>50</a>41 <a class="page-numbers" href="$page50">50</a> 42 42 <a class="next page-numbers" href="$page2">Next »</a> 43 43 EXPECTED; … … 59 59 60 60 $expected = <<<EXPECTED 61 <a class= 'page-numbers' href='$home'>1</a>62 <span aria-current= 'page' class='page-numbers current'>2</span>63 <a class= 'page-numbers' href='$page3'>3</a>64 <a class= 'page-numbers' href='$page4'>4</a>61 <a class="page-numbers" href="$home">1</a> 62 <span aria-current="page" class="page-numbers current">2</span> 63 <a class="page-numbers" href="$page3">3</a> 64 <a class="page-numbers" href="$page4">4</a> 65 65 <span class="page-numbers dots">…</span> 66 <a class= 'page-numbers' href='$page50'>50</a>66 <a class="page-numbers" href="$page50">50</a> 67 67 EXPECTED; 68 68 … … 85 85 $expected = <<<EXPECTED 86 86 <a class="prev page-numbers" href="$home">« Previous</a> 87 <a class= 'page-numbers' href='$home'>1</a>88 <span aria-current= 'page' class='page-numbers current'>2</span>89 <a class= 'page-numbers' href='$page3'>3</a>90 <a class= 'page-numbers' href='$page4'>4</a>87 <a class="page-numbers" href="$home">1</a> 88 <span aria-current="page" class="page-numbers current">2</span> 89 <a class="page-numbers" href="$page3">3</a> 90 <a class="page-numbers" href="$page4">4</a> 91 91 <span class="page-numbers dots">…</span> 92 <a class= 'page-numbers' href='$page50'>50</a>92 <a class="page-numbers" href="$page50">50</a> 93 93 <a class="next page-numbers" href="$page3">Next »</a> 94 94 EXPECTED; … … 334 334 ); 335 335 336 $this->assertContains( "<span aria-current='page' class='page-numbers current'>3</span>", $links );336 $this->assertContains( '<span aria-current="page" class="page-numbers current">3</span>', $links ); 337 337 } 338 338 … … 356 356 357 357 $page_2_url = home_url() . '?foo=2'; 358 $this->assertContains( "<a class= 'page-numbers' href='$page_2_url'>2</a>", $links );358 $this->assertContains( "<a class=\"page-numbers\" href=\"$page_2_url\">2</a>", $links ); 359 359 } 360 360 }
Note: See TracChangeset
for help on using the changeset viewer.