File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,21 @@ function gutenberg_register_gutenberg_rest_block_patterns() {
4343 $ block_patterns ->register_routes ();
4444}
4545add_action ( 'rest_api_init ' , 'gutenberg_register_gutenberg_rest_block_patterns ' , 100 );
46+
47+ /**
48+ * Exposes the site logo URL through the WordPress REST API.
49+ *
50+ * This is used for fetching this information when user has no rights
51+ * to update settings.
52+ *
53+ * Note: Backports into wp-includes/rest-api/class-wp-rest-server.php file.
54+ *
55+ * @param WP_REST_Response $response REST API response.
56+ * @return WP_REST_Response $response REST API response.
57+ */
58+ function gutenberg_add_site_icon_url_to_index ( WP_REST_Response $ response ) {
59+ $ response ->data ['site_icon_url ' ] = get_site_icon_url ();
60+
61+ return $ response ;
62+ }
63+ add_action ( 'rest_index ' , 'gutenberg_add_site_icon_url_to_index ' );
You can’t perform that action at this time.
0 commit comments