WordPress.org

Making WordPress.org

Changeset 6491


Ignore:
Timestamp:
01/31/2018 10:06:15 PM (4 years ago)
Author:
obenland
Message:

O2: More contextual title for profile links.

Props afercia.
See #3371.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r6490 r6491  
    171171}
    172172add_filter( 'jetpack_mentions_linked_mention', __NAMESPACE__ . '\disable_mentions_for_handbook', 10, 2 );
     173
     174/**
     175 * More contextual link title for post authors.
     176 *
     177 * @param array    $bootstrap_model O2 user model.
     178 * @param \WP_User $user_data       User data.
     179 *
     180 * @return array
     181 */
     182function user_model( $bootstrap_model, $user_data ) {
     183    /* translators: 1: User display_name; 2: User nice_name */
     184    $bootstrap_model['urlTitle'] = sprintf( __( 'Profile of %1$s (%2$s)', 'wporg' ), $user_data->display_name, '@' . $user_data->user_nicename );
     185
     186    return $bootstrap_model;
     187}
     188add_filter( 'o2_user_model', __NAMESPACE__ . '\user_model', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.