WordPress.org

Make WordPress Core

Ticket #38935: 38935.patch

File 38935.patch, 855 bytes (added by nikeo, 3 years ago)

add the theme mod name to the dynamic theme_mod_{$name} filters

  • src/wp-includes/theme.php

    diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
    index cf1bb0f..45a3f9e 100644
    a b function get_theme_mod( $name, $default = false ) { 
    867867                 * @since 2.2.0
    868868                 *
    869869                 * @param string $current_mod The value of the current theme modification.
     870     * @param string $name Theme modification name
    870871                 */
    871                 return apply_filters( "theme_mod_{$name}", $mods[$name] );
     872                return apply_filters( "theme_mod_{$name}", $mods[$name], $name );
    872873        }
    873874
    874875        if ( is_string( $default ) )
    875876                $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
    876877
    877878        /** This filter is documented in wp-includes/theme.php */
    878         return apply_filters( "theme_mod_{$name}", $default );
     879        return apply_filters( "theme_mod_{$name}", $default, $name );
    879880}
    880881
    881882/**