Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: block_core_social_link_get_services

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
340       *
341       * This can be used to change icons or add custom icons (additionally to variations in the editor).
342       * Icons should be directly renderable - therefore SVGs work best.
343       *
344       * @since 6.9.0
345       *
346       * @param array $services_data The list of services. Each item is an array containing a 'name' and 'icon' key.
347       * @return array The list of social services.
348       */
349      $services_data = apply_filters( 'block_core_social_link_get_services', $services_data );
350
351      if ( ! empty( $service )
352           && ! empty( $field )
353           && isset( $services_data[ $service ] )
354           && ( 'icon' === $field || 'name' === $field )
355      ) {
356           return $services_data[ $service ][ $field ];
357      } elseif ( ! empty( $service ) && isset( $services_data[ $service ] ) ) {
358           return $services_data[ $service ];