Astra_Customizer::customize_register_site_icon( WP_Customize_Manager $wp_customize )
Add site icon control in the site identity panel.
Description
Parameters
- $wp_customize
-
(WP_Customize_Manager) (Required) Theme Customizer object.
Return
(void)
Source
File: inc/customizer/class-astra-customizer.php
public function customize_register_site_icon( $wp_customize ) {
/** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
if ( true !== Astra_Builder_Helper::$is_header_footer_builder_active ) {
/** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
return;
}
$panel_arr = array(
'priority' => 80,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => 'Site Identity',
'description' => '',
);
// Register panel.
$wp_customize->add_panel( 'astra-site-identity', $panel_arr );
$section_arr = array(
'priority' => 80,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => 'Site Identity',
'description' => '',
);
// Register Section.
$wp_customize->add_section( 'astra-site-identity', $section_arr );
/** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$wp_customize->get_control( 'site_icon' )->section = 'astra-site-identity';
/** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
/** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
$wp_customize->get_control( 'site_icon' )->description = __( 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. Upload one here! Site Icons should be square and at least 512 × 512 pixels.', 'astra' );
/** @psalm-suppress PossiblyNullPropertyAssignment */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 3.6.9 | Introduced. |