Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_theme_mod [ WordPress Function ]

get_theme_mod ( $name, $default = false )
Parameters:
  • (string) $name Theme modification name.
  • (bool|string) $default
Uses:
Returns:
  • (string)
Defined at:



Retrieve theme modification value for the current theme.

If the modification name does not exist, then the $default will be passed through {@link http://php.net/sprintf sprintf()} PHP function with the first string the template directory URI and the second string the stylesheet directory URI.

Source


<?php
function get_theme_mod$name$default false ) {
    
$mods get_theme_mods();

    if ( isset( 
$mods$name ] ) )
        return 
apply_filters"theme_mod_$name"$mods$name ] );

    if ( 
is_string$default ) )
        
$default sprintf$defaultget_template_directory_uri(), get_stylesheet_directory_uri() );

    return 
apply_filters"theme_mod_$name"$default );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics