Make WordPress Core

Ticket #40842: template_filters.patch

File template_filters.patch, 2.5 KB (added by Ninos Ego, 8 years ago)

template_filters_patch20170523

  • src/wp-includes/general-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    4242
    4343        $templates[] = 'header.php';
    4444
     45        /**
     46         * Filters the header templates.
     47         *
     48         * @since 4.8.0
     49         *
     50         * @param array $templates Templates of all possible headers.
     51         * @param string|null $name Name of the specific header file to use.
     52         */
     53        $templates = apply_filters( 'get_header_templates', $templates, $name );
     54
    4555        locate_template( $templates, true );
    4656}
    4757
     
    8191
    8292        $templates[]    = 'footer.php';
    8393
     94        /**
     95         * Filters the footer templates.
     96         *
     97         * @since 4.8.0
     98         *
     99         * @param array $templates Templates of all possible footers.
     100         * @param string|null $name Name of the specific footer file to use.
     101         */
     102        $templates = apply_filters( 'get_footer_templates', $templates, $name );
     103
    84104        locate_template( $templates, true );
    85105}
    86106
     
    119139
    120140        $templates[] = 'sidebar.php';
    121141
     142        /**
     143         * Filters the sidebar templates.
     144         *
     145         * @since 4.8.0
     146         *
     147         * @param array $templates Templates of all possible sidebars.
     148         * @param string|null $name Name of the specific sidebar file to use.
     149         */
     150        $templates = apply_filters( 'get_sidebar_templates', $templates, $name );
     151
    122152        locate_template( $templates, true );
    123153}
    124154
  • src/wp-includes/template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    643643                }
    644644        }
    645645
     646        /**
     647         * Filters the template location.
     648         *
     649         * @since 4.8.0
     650         *
     651         * @param string       $located        Path to the template location.
     652         * @param string|array $template_names Template file(s) to search for, in order.
     653         * @param boolean      $load           If true the template file will be loaded if it is found.
     654         * @param boolean      $require_once   Whether to require_once or require. Default true. Has no effect if $load is false.
     655         */
     656        $located = apply_filters( 'located_template', $located, $template_names, $load, $require_once );
     657
    646658        if ( $load && '' != $located )
    647659                load_template( $located, $require_once );
    648660