mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-21 04:11:59 +08:00
Fixed customizer and PHP 5.2 compatibility, closes #493
This commit is contained in:
parent
6e48800316
commit
eff55ca707
1 changed files with 33 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue