Fixed customizer and PHP 5.2 compatibility, closes #493

This commit is contained in:
Claudio Sanches 2016-10-08 02:22:00 -03:00
parent 6e48800316
commit eff55ca707

View file

@ -151,23 +151,17 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
$wp_customize->selective_refresh->add_partial( 'custom_logo', array(
'selector' => '.site-branding',
'render_callback' => function() {
storefront_site_title_or_logo();
},
'render_callback' => array( $this, 'get_site_logo' ),
) );
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '.site-title.beta a',
'render_callback' => function() {
bloginfo( 'name' );
},
'render_callback' => array( $this, 'get_site_name' ),
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '.site-description',
'render_callback' => function() {
bloginfo( 'description' );
},
'render_callback' => array( $this, 'get_site_description' ),
) );
}
@ -885,6 +879,36 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
</style>
<?php
}
/**
* Get site logo.
*
* @since 2.1.5
* @return string
*/
public function get_site_logo() {
return storefront_site_title_or_logo( false );
}
/**
* Get site name.
*
* @since 2.1.5
* @return string
*/
public function get_site_name() {
return get_bloginfo( 'name', 'display' );
}
/**
* Get site description.
*
* @since 2.1.5
* @return string
*/
public function get_site_description() {
return get_bloginfo( 'description', 'display' );
}
}
endif;