Changeset 54247
- Timestamp:
- 09/20/2022 09:57:43 AM (23 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r54071 r54247 1562 1562 * 1563 1563 * @since 2.7.0 1564 1564 1565 * 1565 1566 * @global array $wp_settings_sections Storage array of all settings sections added to admin pages. … … 1571 1572 * 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using 1572 1573 * add_options_page(); 1573 */ 1574 function add_settings_section( $id, $title, $callback, $page ) { 1574 * @param array $args { 1575 * Arguments used to create the settings section. 1576 * 1577 * @type string $before_section HTML content to prepend to the section's HTML output. 1578 * Receives the section's class name as `%s`. Default empty. 1579 * @type string $after_section HTML content to append to the section's HTML output. Default empty. 1580 * @type string $section_class The class name to use for the section. Default empty. 1581 * } 1582 */ 1583 function add_settings_section( $id, $title, $callback, $page, $args = array() ) { 1575 1584 global $wp_settings_sections; 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1576 1596 1577 1597 if ( 'misc' === $page ) { … … 1601 1621 } 1602 1622 1603 $wp_settings_sections[ $page ][ $id ] = array( 1604 'id' => $id, 1605 'title' => $title, 1606 'callback' => $callback, 1607 ); 1623 $wp_settings_sections[ $page ][ $id ] = $section; 1608 1624 } 1609 1625 … … 1701 1717 1702 1718 foreach ( (array) $wp_settings_sections[ $page ] as $section ) { 1719 1720 1721 1722 1723 1724 1725 1726 1703 1727 if ( $section['title'] ) { 1704 1728 echo "<h2>{$section['title']}</h2>\n"; … … 1715 1739 do_settings_fields( $page, $section['id'] ); 1716 1740 echo '</table>'; 1741 1742 1743 1744 1717 1745 } 1718 1746 } -
trunk/tests/phpunit/tests/template.php
r51568 r54247 457 457 } 458 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 459 631 460 632 public function assertTemplateHierarchy( $url, array $expected, $message = '' ) {
Note: See TracChangeset
for help on using the changeset viewer.