WordPress.org

Make WordPress Core

Ticket #24273: 24273-public-contactmethods.diff

File 24273-public-contactmethods.diff, 2.3 KB (added by johnnyb, 5 years ago)

Make the method public.

  • .

  • wp-admin/includes/user.php

     
    8585        if ( isset( $_POST['description'] ) )
    8686                $user->description = trim( $_POST['description'] );
    8787
    88         foreach ( _wp_get_user_contactmethods( $user ) as $method => $name ) {
     88        foreach ( wp_get_user_contactmethods( $user ) as $method => $name ) {
    8989                if ( isset( $_POST[$method] ))
    9090                        $user->$method = sanitize_text_field( $_POST[$method] );
    9191        }
  • wp-admin/user-edit.php

     
    351351</tr>
    352352
    353353<?php
    354         foreach (_wp_get_user_contactmethods( $profileuser ) as $name => $desc) {
     354        foreach (wp_get_user_contactmethods( $profileuser ) as $name => $desc) {
    355355?>
    356356<tr>
    357357        <th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th>
  • wp-includes/user.php

     
    15201520 */
    15211521function _get_additional_user_keys( $user ) {
    15221522        $keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front' );
    1523         return array_merge( $keys, array_keys( _wp_get_user_contactmethods( $user ) ) );
     1523        return array_merge( $keys, array_keys( wp_get_user_contactmethods( $user ) ) );
    15241524}
    15251525
    15261526/**
     
    15291529 * Default contact methods were removed in 3.6. A filter dictates contact methods.
    15301530 *
    15311531 * @since 2.9.0
    1532  * @access private
     1532 * @access public
    15331533 *
    15341534 * @param object $user User data object (optional).
    15351535 * @return array $user_contactmethods Array of contact methods and their labels.
    15361536 */
    1537 function _wp_get_user_contactmethods( $user = null ) {
     1537function wp_get_user_contactmethods( $user = null ) {
    15381538        $user_contactmethods = array();
    15391539        if ( get_site_option( 'initial_db_version' ) < 23588 ) {
    15401540                $user_contactmethods = array(