Skip to:
Content

BuddyPress.org

Changeset 10657


Ignore:
Timestamp:
03/16/2016 08:19:44 PM (8 years ago)
Author:
djpaul
Message:

xprofile: don't auto-link the Name field to a search.

Display names ought to be almost always unique. Performing a member
directory search on the default "Name" field (auto-linked) is only
going to retrieve the member whose profile you were on when you clicked
the search link.

Removing this hardcoded exception allows site administrators to choose
whether this field is auto-linked via the existing wp-admin Extended
Profiles metaboxes.

Fixes #6955

Props slaFFik

Location:
trunk/src/bp-xprofile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r10652 r10657  
    419419
    420420                // Save autolink settings.
    421                 if ( 1 != $field_id ) {
    422                     if ( isset( $_POST['do_autolink'] ) && 'on' === wp_unslash( $_POST['do_autolink'] ) ) {
    423                         bp_xprofile_update_field_meta( $field_id, 'do_autolink', 'on' );
    424                     } else {
    425                         bp_xprofile_update_field_meta( $field_id, 'do_autolink', 'off' );
    426                     }
     421                if ( isset( $_POST['do_autolink'] ) && 'on' === wp_unslash( $_POST['do_autolink'] ) ) {
     422                    bp_xprofile_update_field_meta( $field_id, 'do_autolink', 'on' );
     423                } else {
     424                    bp_xprofile_update_field_meta( $field_id, 'do_autolink', 'off' );
    427425                }
    428426
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r10584 r10657  
    818818
    819819            if ( '' === $do_autolink ) {
    820                 $this->do_autolink = $this->is_default_field() || $this->type_obj->supports_options;
     820                $this->do_autolink = $this->type_obj->supports_options;
    821821            } else {
    822822                $this->do_autolink = 'on' === $do_autolink;
     
    14571457     */
    14581458    private function autolink_metabox() {
    1459 
    1460         // Default field cannot have custom visibility.
    1461         if ( true === $this->is_default_field() ) {
    1462             return;
    1463         }
    1464 
    14651459        ?>
    14661460
Note: See TracChangeset for help on using the changeset viewer.