WordPress.org

Make WordPress Core

Ticket #26636: 26636.diff

File 26636.diff, 612 bytes (added by shelob9, 6 years ago)

Adds a filter to get_sidebar

  • wp-includes/general-template.php

    diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
    index 7a83579..999d1e3 100644
    a b function get_footer( $name = null ) { 
    8282 * @param string $name The name of the specialised sidebar.
    8383 */
    8484function get_sidebar( $name = null ) {
     85    /**
     86     * Filter to override sidebar set in theme.
     87     *
     88     * @params string $name, which sidebar to use
     89     * @since 3.9.0
     90     */
     91    $name = apply_filters('get_sidebar', $name);
    8592        do_action( 'get_sidebar', $name );
    8693
    8794        $templates = array();