summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/site-logo.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/blocks/site-logo.php')
-rw-r--r--wp-includes/blocks/site-logo.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/wp-includes/blocks/site-logo.php b/wp-includes/blocks/site-logo.php
index f1819fc..ea6d9f1 100644
--- a/wp-includes/blocks/site-logo.php
+++ b/wp-includes/blocks/site-logo.php
@@ -8,6 +8,8 @@
/**
* Renders the `core/site-logo` block on the server.
*
+ * @since 5.8.0
+ *
* @param array $attributes The block attributes.
*
* @return string The render.
@@ -60,6 +62,8 @@ function render_block_core_site_logo( $attributes ) {
/**
* Register a core site setting for a site logo
+ *
+ * @since 5.8.0
*/
function register_block_core_site_logo_setting() {
register_setting(
@@ -70,6 +74,7 @@ function register_block_core_site_logo_setting() {
'name' => 'site_logo',
),
'type' => 'integer',
+ 'label' => __( 'Logo' ),
'description' => __( 'Site logo.' ),
)
);
@@ -79,6 +84,8 @@ add_action( 'rest_api_init', 'register_block_core_site_logo_setting', 10 );
/**
* Register a core site setting for a site icon
+ *
+ * @since 5.9.0
*/
function register_block_core_site_icon_setting() {
register_setting(
@@ -87,6 +94,7 @@ function register_block_core_site_icon_setting() {
array(
'show_in_rest' => true,
'type' => 'integer',
+ 'label' => __( 'Icon' ),
'description' => __( 'Site icon.' ),
)
);
@@ -96,6 +104,8 @@ add_action( 'rest_api_init', 'register_block_core_site_icon_setting', 10 );
/**
* Registers the `core/site-logo` block on the server.
+ *
+ * @since 5.8.0
*/
function register_block_core_site_logo() {
register_block_type_from_metadata(
@@ -111,6 +121,8 @@ add_action( 'init', 'register_block_core_site_logo' );
/**
* Overrides the custom logo with a site logo, if the option is set.
*
+ * @since 5.8.0
+ *
* @param string $custom_logo The custom logo set by a theme.
*
* @return string The site logo if set.
@@ -125,6 +137,8 @@ add_filter( 'theme_mod_custom_logo', '_override_custom_logo_theme_mod' );
/**
* Updates the site_logo option when the custom_logo theme-mod gets updated.
*
+ * @since 5.8.0
+ *
* @param mixed $value Attachment ID of the custom logo or an empty value.
* @return mixed
*/
@@ -143,6 +157,8 @@ add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );
/**
* Deletes the site_logo when the custom_logo theme mod is removed.
*
+ * @since 5.8.0
+ *
* @param array $old_value Previous theme mod settings.
* @param array $value Updated theme mod settings.
*/
@@ -161,6 +177,8 @@ function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) {
/**
* Deletes the site logo when all theme mods are being removed.
+ *
+ * @since 5.8.0
*/
function _delete_site_logo_on_remove_theme_mods() {
global $_ignore_site_logo_changes;
@@ -179,6 +197,8 @@ function _delete_site_logo_on_remove_theme_mods() {
* Hooks `_delete_site_logo_on_remove_theme_mods` in `delete_option_theme_mods_$theme`.
*
* Runs on `setup_theme` to account for dynamically-switched themes in the Customizer.
+ *
+ * @since 5.8.0
*/
function _delete_site_logo_on_remove_custom_logo_on_setup_theme() {
$theme = get_option( 'stylesheet' );
@@ -189,6 +209,8 @@ add_action( 'setup_theme', '_delete_site_logo_on_remove_custom_logo_on_setup_the
/**
* Removes the custom_logo theme-mod when the site_logo option gets deleted.
+ *
+ * @since 5.9.0
*/
function _delete_custom_logo_on_remove_site_logo() {
global $_ignore_site_logo_changes;