Changeset 8652
- Timestamp:
- 07/20/2014 08:05:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-classes.php
r8650 r8652 1561 1561 public function edit_field_options_html( array $args = array() ) { 1562 1562 1563 $date = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ); 1564 $day = 0; 1565 $month = 0; 1566 $year = 0; 1567 $html = ''; 1563 $date = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ); 1564 $day = 0; 1565 $month = 0; 1566 $year = 0; 1567 $html = ''; 1568 $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); 1568 1569 1569 1570 // Set day, month, year defaults … … 1592 1593 1593 1594 if ( ! empty( $_POST['field_' . $this->field_obj->id . '_month'] ) ) { 1594 $new_month = (int) $_POST['field_' . $this->field_obj->id . '_month']; 1595 $month = ( $month != $new_month ) ? $new_month : $month; 1595 if ( in_array( $_POST['field_' . $this->field_obj->id . '_month'], $eng_months ) ) { 1596 $new_month = $_POST['field_' . $this->field_obj->id . '_month']; 1597 } else { 1598 $new_month = $month; 1599 } 1600 1601 $month = ( $month !== $new_month ) ? $new_month : $month; 1596 1602 } 1597 1603 1598 1604 if ( ! empty( $_POST['field_' . $this->field_obj->id . '_year'] ) ) { 1599 $new_year = date( 'j', (int) $_POST['field_' . $this->field_obj->id . '_year'] );1605 $new_year = (int) $_POST['field_' . $this->field_obj->id . '_year']; 1600 1606 $year = ( $year != $new_year ) ? $new_year : $year; 1601 1607 } … … 1612 1618 1613 1619 case 'month': 1614 $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );1615 1616 1620 $months = array( 1617 1621 __( 'January', 'buddypress' ),
Note: See TracChangeset
for help on using the changeset viewer.