Skip to:
Content

BuddyPress.org

Changeset 10243


Ignore:
Timestamp:
10/11/2015 12:52:31 PM (5 years ago)
Author:
djpaul
Message:

xprofile: fix PHP notice when adding new profile field with no name

When adding a new profile field in wp-admin, clicking save without
entering the field name can cause a PHP notice because the
“sort_order_{field_type}” property is not set for every field type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r10229 r10243  
    11051105                $this->is_required = $_POST['required'];
    11061106                $this->type        = $_POST['fieldtype'];
    1107                 $this->order_by    = $_POST["sort_order_{$this->type}"];
    11081107                $this->field_order = $_POST['field_order'];
     1108
     1109                if ( ! empty( $_POST["sort_order_{$this->type}"] ) ) {
     1110                    $this->order_by = $_POST["sort_order_{$this->type}"];
     1111                }
    11091112            }
    11101113        } else {
Note: See TracChangeset for help on using the changeset viewer.