PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/block-library/social-link.php +6 -14 23.7.2 → trunk View file →
@@ -9,12 +9,11 @@
9 9 * Renders the `core/social-link` block on server.
10 10 *
11 11 * @since 5.4.0
12 12 *
13 - * @param Array $attributes The block attributes.
14 - * @param String $content InnerBlocks content of the Block.
13 + * @param array $attributes The block attributes.
14 + * @param string $content InnerBlocks content of the Block.
15 15 * @param WP_Block $block Block object.
16 - *
17 16 * @return string Rendered HTML of the referenced block.
18 17 */
19 18 function gutenberg_render_block_core_social_link( $attributes, $content, $block ) {
20 19 $open_in_new_tab = $block->context['openInNewTab'] ?? false;
@@ -38,9 +37,9 @@
38 37 if ( ! is_string( $url ) ) {
39 38 return '';
40 39 }
41 40
42 - /**
41 + /*
43 42 * Prepend emails with `mailto:` if not set.
44 43 * The `is_email` returns false for emails with schema.
45 44 */
46 45 if ( is_email( $url ) ) {
@@ -46,9 +45,9 @@
46 45 if ( is_email( $url ) ) {
47 46 $url = 'mailto:' . antispambot( $url );
48 47 }
49 48
50 - /**
49 + /*
51 50 * Prepend URL with https:// if it doesn't appear to contain a scheme
52 51 * and it's not a relative link or a fragment.
53 52 */
54 53 if ( ! parse_url( $url, PHP_URL_SCHEME ) && ! str_starts_with( $url, '//' ) && ! str_starts_with( $url, '#' ) ) {
@@ -94,9 +93,8 @@
94 93 );
95 94 }
96 95 add_action( 'init', 'gutenberg_register_block_core_social_link', 20 );
97 96
98 -
99 97 /**
100 98 * Returns the SVG for social link.
101 99 *
102 100 * @since 5.4.0
@@ -101,9 +99,8 @@
101 99 *
102 100 * @since 5.4.0
103 101 *
104 102 * @param string $service The service icon.
105 - *
106 103 * @return string SVG Element for service icon.
107 104 */
108 105 function gutenberg_block_core_social_link_get_icon( $service ) {
109 106 $services = gutenberg_block_core_social_link_services();
@@ -119,9 +116,8 @@
119 116 *
120 117 * @since 5.4.0
121 118 *
122 119 * @param string $service The service icon.
123 - *
124 120 * @return string Brand label.
125 121 */
126 122 function gutenberg_block_core_social_link_get_name( $service ) {
127 123 $services = gutenberg_block_core_social_link_services();
@@ -137,10 +133,9 @@
137 133 *
138 134 * @since 5.4.0
139 135 *
140 136 * @param string $service The service slug to extract data from.
141 - * @param string $field The field ('name', 'icon', etc) to extract for a service.
142 - *
137 + * @param string $field The field ('name', 'icon', etc) to extract for a service.
143 138 * @return array|string
144 139 */
145 140 function gutenberg_block_core_social_link_services( $service = '', $field = '' ) {
146 141 if ( ! is_string( $service ) || ! is_string( $field ) ) {
@@ -345,9 +340,9 @@
345 340 ),
346 341 );
347 342
348 343 /**
349 - * Filter the list of available social service.
344 + * Filters the list of available social service.
350 345 *
351 346 * This can be used to change icons or add custom icons (additionally to variations in the editor).
352 347 * Icons should be directly renderable - therefore SVGs work best.
353 348 *
@@ -353,9 +348,8 @@
353 348 *
354 349 * @since 6.9.0
355 350 *
356 351 * @param array $services_data The list of services. Each item is an array containing a 'name' and 'icon' key.
357 - * @return array The list of social services.
358 352 */
359 353 $services_data = apply_filters( 'block_core_social_link_get_services', $services_data );
360 354
361 355 if ( ! empty( $service )
@@ -376,9 +370,8 @@
376 370 *
377 371 * @since 5.7.0
378 372 *
379 373 * @param array $context Block context passed to Social Link.
380 - *
381 374 * @return string Inline CSS styles for link's icon and background colors.
382 375 */
383 376 function gutenberg_block_core_social_link_get_color_styles( $context ) {
384 377 $styles = array();
@@ -399,9 +392,8 @@
399 392 *
400 393 * @since 6.3.0
401 394 *
402 395 * @param array $context Block context passed to Social Sharing Link.
403 - *
404 396 * @return string CSS classes for link's icon and background colors.
405 397 */
406 398 function gutenberg_block_core_social_link_get_color_classes( $context ) {
407 399 $classes = array();