WordPress.org

Make WordPress Core

Ticket #38545: 38545.patch

File 38545.patch, 22.3 KB (added by shireling, 3 years ago)
  • .idea/workspace.xml

    diff --git a/.idea/workspace.xml b/.idea/workspace.xml
    index 32e3c2a..94dcdc5 100644
    a b  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<project version="4">
    33  <component name="ChangeListManager">
    4     <list default="true" id="f82a182f-5e21-4059-9d7e-b5cf59e8f007" name="Default" comment="" />
     4    <list default="true" id="f82a182f-5e21-4059-9d7e-b5cf59e8f007" name="Default" comment="">
     5      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
     6    </list>
    57    <ignored path="wordpress-develop.iws" />
    68    <ignored path=".idea/workspace.xml" />
    79    <ignored path=".idea/dataSources.local.xml" />
     
    2123    <favorites_list name="wordpress-develop" />
    2224  </component>
    2325  <component name="FileEditorManager">
    24     <leaf />
     26    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
     27      <file leaf-file-name="general-template.php" pinned="false" current-in-tab="true">
     28        <entry file="file://$PROJECT_DIR$/src/wp-includes/general-template.php">
     29          <provider selected="true" editor-type-id="text-editor">
     30            <state relative-caret-position="-45">
     31              <caret line="1508" column="34" selection-start-line="1508" selection-start-column="34" selection-end-line="1508" selection-end-column="34" />
     32              <folding>
     33                <marker date="1485185771000" expanded="true" signature="28837:28850" placeholder="..." />
     34                <marker date="1485185771000" expanded="true" signature="55478:55660" placeholder="SELECT YEAR(... " />
     35                <marker date="1485185771000" expanded="true" signature="56552:56687" placeholder="SELECT YEAR(... " />
     36                <marker date="1485185771000" expanded="true" signature="57452:57696" placeholder="SELECT YEAR(... " />
     37                <marker date="1485185771000" expanded="true" signature="58667:58905" placeholder="SELECT DISTI... " />
     38                <marker date="1485185771000" expanded="true" signature="60309:60367" placeholder="SELECT * FRO... ${$wpdb-&gt;posts}" />
     39                <marker date="1485185771000" expanded="true" signature="62670:62765" placeholder="SELECT 1 as ${$wpdb-&gt;posts}" />
     40                <marker date="1485185771000" expanded="true" signature="64003:64217" placeholder="SELECT MONTH... " />
     41                <marker date="1485185771000" expanded="true" signature="64246:64477" placeholder="SELECT MONTH... " />
     42                <marker date="1485185771000" expanded="true" signature="64653:64794" placeholder="..." />
     43                <marker date="1485185771000" expanded="true" signature="64788:64794" placeholder="..." />
     44                <marker date="1485185771000" expanded="true" signature="65239:65245" placeholder="..." />
     45                <marker date="1485185771000" expanded="true" signature="66048:66054" placeholder="..." />
     46                <marker date="1485185771000" expanded="true" signature="66147:66382" placeholder="SELECT DISTI... ${$wpdb-&gt;posts}" />
     47              </folding>
     48            </state>
     49          </provider>
     50        </entry>
     51      </file>
     52    </leaf>
    2553  </component>
    2654  <component name="Git.Settings">
    2755    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
     
    3058    <option name="CHANGED_PATHS">
    3159      <list>
    3260        <option value="$PROJECT_DIR$/.gitignore" />
     61        <option value="$PROJECT_DIR$/src/wp-includes/general-template.php" />
    3362      </list>
    3463    </option>
    3564  </component>
     
    3968    <detection-done>true</detection-done>
    4069    <sorting>DEFINITION_ORDER</sorting>
    4170  </component>
     71  <component name="PhpServers">
     72    <servers />
     73  </component>
    4274  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
    4375  <component name="ProjectFrameBounds">
    4476    <option name="width" value="1440" />
     
    69101      <foldersAlwaysOnTop value="true" />
    70102    </navigator>
    71103    <panes>
     104      <pane id="Scratches" />
    72105      <pane id="ProjectPane">
    73106        <subPane>
    74107          <PATH>
     
    121154          </PATH>
    122155        </subPane>
    123156      </pane>
    124       <pane id="Scratches" />
    125       <pane id="Scope" />
     157      <pane id="Scope">
     158        <subPane subId="Project Files" />
     159      </pane>
    126160    </panes>
    127161  </component>
    128162  <component name="PropertiesComponent">
    129163    <property name="WebServerToolWindowFactoryState" value="false" />
    130164    <property name="FullScreen" value="true" />
     165    <property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" />
     166  </component>
     167  <component name="RunManager">
     168    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
     169      <method />
     170    </configuration>
     171    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
     172      <method />
     173    </configuration>
     174    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
     175      <TestRunner />
     176      <method />
     177    </configuration>
     178    <configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
     179      <BehatRunner />
     180      <method />
     181    </configuration>
     182    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
     183      <method />
     184    </configuration>
     185    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
     186      <method />
     187    </configuration>
     188    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
     189      <command value="run-script" />
     190      <scripts />
     191      <node-interpreter value="project" />
     192      <envs />
     193      <method />
     194    </configuration>
     195    <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
     196      <node-interpreter>project</node-interpreter>
     197      <node-options />
     198      <working-directory>$PROJECT_DIR$</working-directory>
     199      <pass-parent-env>true</pass-parent-env>
     200      <envs />
     201      <ui>bdd</ui>
     202      <extra-mocha-options />
     203      <test-kind>DIRECTORY</test-kind>
     204      <test-directory />
     205      <recursive>false</recursive>
     206      <method />
     207    </configuration>
    131208  </component>
    132209  <component name="ShelveChangesManager" show_recycled="false">
    133210    <option name="remove_strategy" value="false" />
    134211  </component>
     212  <component name="SvnConfiguration">
     213    <configuration />
     214  </component>
    135215  <component name="TaskManager">
    136216    <task active="true" id="Default" summary="Default task">
    137217      <changelist id="f82a182f-5e21-4059-9d7e-b5cf59e8f007" name="Default" comment="" />
     
    140220      <option name="presentableId" value="Default" />
    141221      <updated>1485017489997</updated>
    142222      <workItem from="1485017491516" duration="3173000" />
     223      <workItem from="1485031724031" duration="77000" />
     224      <workItem from="1485031827077" duration="1765000" />
    143225    </task>
    144226    <servers />
    145227  </component>
    146228  <component name="TimeTrackingManager">
    147     <option name="totallyTimeSpent" value="3173000" />
     229    <option name="totallyTimeSpent" value="5015000" />
    148230  </component>
    149231  <component name="ToolWindowManager">
    150232    <frame x="0" y="0" width="1440" height="900" extended-state="0" />
    151233    <editor active="false" />
    152234    <layout>
    153       <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2532189" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
     235      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25608012" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
    154236      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
    155       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
    156       <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
    157       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
    158       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    159       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32891566" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
    160       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
     237      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
     238      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
     239      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
     240      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
     241      <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2807229" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
     242      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
    161243      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
    162       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
    163244      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
    164245      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
    165       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    166246      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    167247      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
     248      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
     249      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    168250      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    169251      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    170252    </layout>
    171253  </component>
     254  <component name="Vcs.Log.UiProperties">
     255    <option name="RECENTLY_FILTERED_USER_GROUPS">
     256      <collection />
     257    </option>
     258    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
     259      <collection />
     260    </option>
     261  </component>
    172262  <component name="VcsContentAnnotationSettings">
    173263    <option name="myLimit" value="2678400000" />
    174264  </component>
     
    177267    <watches-manager />
    178268  </component>
    179269  <component name="editorHistoryManager">
     270    <entry file="file://$PROJECT_DIR$/src/wp-includes/general-template.php">
     271      <provider selected="true" editor-type-id="text-editor">
     272        <state relative-caret-position="0">
     273          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
     274          <folding>
     275            <marker date="1485185771000" expanded="true" signature="28837:28850" placeholder="..." />
     276            <marker date="1485185771000" expanded="true" signature="55478:55660" placeholder="SELECT YEAR(... " />
     277            <marker date="1485185771000" expanded="true" signature="56552:56687" placeholder="SELECT YEAR(... " />
     278            <marker date="1485185771000" expanded="true" signature="57452:57696" placeholder="SELECT YEAR(... " />
     279            <marker date="1485185771000" expanded="true" signature="58667:58905" placeholder="SELECT DISTI... " />
     280            <marker date="1485185771000" expanded="true" signature="60309:60367" placeholder="SELECT * FRO... ${$wpdb-&gt;posts}" />
     281            <marker date="1485185771000" expanded="true" signature="62670:62765" placeholder="SELECT 1 as ${$wpdb-&gt;posts}" />
     282            <marker date="1485185771000" expanded="true" signature="64003:64217" placeholder="SELECT MONTH... " />
     283            <marker date="1485185771000" expanded="true" signature="64246:64477" placeholder="SELECT MONTH... " />
     284            <marker date="1485185771000" expanded="true" signature="64653:64794" placeholder="..." />
     285            <marker date="1485185771000" expanded="true" signature="64788:64794" placeholder="..." />
     286            <marker date="1485185771000" expanded="true" signature="65239:65245" placeholder="..." />
     287            <marker date="1485185771000" expanded="true" signature="66048:66054" placeholder="..." />
     288            <marker date="1485185771000" expanded="true" signature="66147:66382" placeholder="SELECT DISTI... ${$wpdb-&gt;posts}" />
     289          </folding>
     290        </state>
     291      </provider>
     292    </entry>
    180293    <entry file="file://$PROJECT_DIR$/.gitignore">
    181294      <provider selected="true" editor-type-id="text-editor">
    182295        <state relative-caret-position="30">
    183296          <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
    184           <folding />
     297        </state>
     298      </provider>
     299    </entry>
     300    <entry file="file://$PROJECT_DIR$/src/wp-includes/general-template.php">
     301      <provider selected="true" editor-type-id="text-editor">
     302        <state relative-caret-position="-45">
     303          <caret line="1508" column="34" selection-start-line="1508" selection-start-column="34" selection-end-line="1508" selection-end-column="34" />
     304          <folding>
     305            <marker date="1485185771000" expanded="true" signature="28837:28850" placeholder="..." />
     306            <marker date="1485185771000" expanded="true" signature="55478:55660" placeholder="SELECT YEAR(... " />
     307            <marker date="1485185771000" expanded="true" signature="56552:56687" placeholder="SELECT YEAR(... " />
     308            <marker date="1485185771000" expanded="true" signature="57452:57696" placeholder="SELECT YEAR(... " />
     309            <marker date="1485185771000" expanded="true" signature="58667:58905" placeholder="SELECT DISTI... " />
     310            <marker date="1485185771000" expanded="true" signature="60309:60367" placeholder="SELECT * FRO... ${$wpdb-&gt;posts}" />
     311            <marker date="1485185771000" expanded="true" signature="62670:62765" placeholder="SELECT 1 as ${$wpdb-&gt;posts}" />
     312            <marker date="1485185771000" expanded="true" signature="64003:64217" placeholder="SELECT MONTH... " />
     313            <marker date="1485185771000" expanded="true" signature="64246:64477" placeholder="SELECT MONTH... " />
     314            <marker date="1485185771000" expanded="true" signature="64653:64794" placeholder="..." />
     315            <marker date="1485185771000" expanded="true" signature="64788:64794" placeholder="..." />
     316            <marker date="1485185771000" expanded="true" signature="65239:65245" placeholder="..." />
     317            <marker date="1485185771000" expanded="true" signature="66048:66054" placeholder="..." />
     318            <marker date="1485185771000" expanded="true" signature="66147:66382" placeholder="SELECT DISTI... ${$wpdb-&gt;posts}" />
     319          </folding>
    185320        </state>
    186321      </provider>
    187322    </entry>
  • src/wp-includes/general-template.php

    diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
    index fea6c5b..715dab7 100644
    a b function the_archive_title( $before = '', $after = '' ) { 
    14601460 * @return string Archive title.
    14611461 */
    14621462function get_the_archive_title() {
    1463         if ( is_category() || is_tag() || is_author() || is_year() || is_month() || is_day() || is_post_type_archive() || ( is_tax() && ! is_tax( 'post_format') ) ) {
    1464                 $title_classes = 'archive-title';
    1465                 if ( is_category() ) {
    1466                         /* translators: Category archive title. 1: Category name */
    1467                         $type = __( 'Category: ' );
    1468                         $name = single_cat_title( '', false );
    1469                 } elseif ( is_tag() ) {
    1470                         /* translators: Tag archive title. 1: Tag name */
    1471                         $type = __( 'Tag: ' );
    1472                         $name = single_tag_title( '', false );
    1473                 } elseif ( is_author() ) {
    1474                         /* translators: Author archive title. 1: Author name */
    1475                         $type = __( 'Author: ' );
    1476                         $name = get_the_author();
    1477                         $title_classes .= ' vcard';
    1478                 } elseif ( is_year() ) {
    1479                         /* translators: Yearly archive title. 1: Year */
    1480                         $type = __( 'Year: ' );
    1481                         $name = get_the_date( _x( 'Y', 'yearly archives date format' ) );
    1482                 } elseif ( is_month() ) {
    1483                         /* translators: Monthly archive title. 1: Month name and year */
    1484                         $type = __( 'Month: ' );
    1485                         $name = get_the_date( _x( 'F Y', 'monthly archives date format' ) );
    1486                 } elseif ( is_day() ) {
    1487                         /* translators: Daily archive title. 1: Date */
    1488                         $type =__( 'Day: ' );
    1489                         $name = get_the_date( _x( 'F j, Y', 'daily archives date format' ) );
    1490                 } elseif ( is_post_type_archive() ) {
    1491                         /* translators: Post type archive title. 1: Post type name */
    1492                         $type = __( 'Archives: ' );
    1493                         $name = post_type_archive_title( '', false );
    1494                 } elseif ( is_tax() ) {
    1495                         $tax = get_taxonomy( get_queried_object()->taxonomy );
    1496                         /* translators: Taxonomy term archive title. 1: Taxonomy singular name */
    1497                         $type = sprintf( __( '%s: ' ), $tax->labels->singular_name );
    1498                         $name =  single_term_title( '', false );
    1499                 }
    1500                 $format ='<span class="archive-label">%s</span><span class="%s">%s</span>';
    1501                 $title = sprintf( $format, $type, $title_classes, $name );
     1463        if ( is_category() ) {
     1464                /* translators: Category archive title. 1: Category name */
     1465                $title = sprintf( __( 'Category: %s' ), single_cat_title( '', false ) );
     1466        } elseif ( is_tag() ) {
     1467                /* translators: Tag archive title. 1: Tag name */
     1468                $title = sprintf( __( 'Tag: %s' ), single_tag_title( '', false ) );
     1469        } elseif ( is_author() ) {
     1470                /* translators: Author archive title. 1: Author name */
     1471                $title = sprintf( __( 'Author: %s' ), '<span class="vcard">' . get_the_author() . '</span>' );
     1472        } elseif ( is_year() ) {
     1473                /* translators: Yearly archive title. 1: Year */
     1474                $title = sprintf( __( 'Year: %s' ), get_the_date( _x( 'Y', 'yearly archives date format' ) ) );
     1475        } elseif ( is_month() ) {
     1476                /* translators: Monthly archive title. 1: Month name and year */
     1477                $title = sprintf( __( 'Month: %s' ), get_the_date( _x( 'F Y', 'monthly archives date format' ) ) );
     1478        } elseif ( is_day() ) {
     1479                /* translators: Daily archive title. 1: Date */
     1480                $title = sprintf( __( 'Day: %s' ), get_the_date( _x( 'F j, Y', 'daily archives date format' ) ) );
    15021481        } elseif ( is_tax( 'post_format' ) ) {
    15031482                if ( is_tax( 'post_format', 'post-format-aside' ) ) {
    15041483                        $title = _x( 'Asides', 'post format archive title' );
    function get_the_archive_title() { 
    15191498                } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
    15201499                        $title = _x( 'Chats', 'post format archive title' );
    15211500                }
     1501        } elseif ( is_post_type_archive() ) {
     1502                /* translators: Post type archive title. 1: Post type name */
     1503                $title = sprintf( __( 'Archives: %s' ), post_type_archive_title( '', false ) );
     1504        } elseif ( is_tax() ) {
     1505                $tax = get_taxonomy( get_queried_object()->taxonomy );
     1506                /* translators: Taxonomy term archive title. 1: Taxonomy singular name, 2: Current taxonomy term */
     1507                $title = sprintf( __( '%1$s: %2$s' ), $tax->labels->singular_name, single_term_title( '', false ) );
    15221508        } else {
    15231509                $title = __( 'Archives' );
    15241510        }
    function get_the_archive_title() { 
    15321518         */
    15331519        return apply_filters( 'get_the_archive_title', $title );
    15341520}
     1521
    15351522/**
    15361523 * Display category, tag, term, or author description.
    15371524 *