- Timestamp:
- 10/01/2015 04:18:13 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php
r10140 r10163 18 18 19 19 /** 20 * Constructor for the checkbox field type 20 * Constructor for the checkbox field type. 21 21 * 22 22 * @since 2.0.0 23 23 */ 24 24 public function __construct() { 25 25 parent::__construct(); … … 50 50 * Must be used inside the {@link bp_profile_fields()} template loop. 51 51 * 52 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.checkbox.html permitted attributes} that you want to add.53 52 * @since 2.0.0 53 * 54 * @param array $raw_properties Optional key/value array of 55 * {@link http://dev.w3.org/html5/markup/input.checkbox.html permitted attributes} 56 * that you want to add. 54 57 */ 55 58 public function edit_field_html( array $raw_properties = array() ) { 56 59 57 // user_id is a special optional parameter that we pass to60 // User_id is a special optional parameter that we pass to 58 61 // {@link bp_the_profile_field_options()}. 59 62 if ( isset( $raw_properties['user_id'] ) ) { … … 97 100 * Must be used inside the {@link bp_profile_fields()} template loop. 98 101 * 102 * @since 2.0.0 103 * 99 104 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. 100 * @since 2.0.0101 105 */ 102 106 public function edit_field_options_html( array $args = array() ) { … … 108 112 109 113 // Check for updated posted values, but errors preventing them from 110 // being saved first time 114 // being saved first time. 111 115 if ( isset( $_POST['field_' . $this->field_obj->id] ) && $option_values != maybe_serialize( $_POST['field_' . $this->field_obj->id] ) ) { 112 116 if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) { … … 118 122 $selected = ''; 119 123 120 // First, check to see whether the user's saved values match the option 124 // First, check to see whether the user's saved values match the option. 121 125 for ( $j = 0, $count_values = count( $option_values ); $j < $count_values; ++$j ) { 122 126 123 127 // Run the allowed option name through the before_save filter, 124 // so we'll be sure to get a match 128 // so we'll be sure to get a match. 125 129 $allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false ); 126 130 … … 132 136 133 137 // If the user has not yet supplied a value for this field, check to 134 // see whether there is a default value available 138 // see whether there is a default value available. 135 139 if ( empty( $option_values ) && empty( $selected ) && ! empty( $options[$k]->is_default_option ) ) { 136 140 $selected = ' checked="checked"'; … … 167 171 * Must be used inside the {@link bp_profile_fields()} template loop. 168 172 * 173 * @since 2.0.0 174 * 169 175 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. 170 * @since 2.0.0171 176 */ 172 177 public function admin_field_html( array $raw_properties = array() ) { … … 179 184 * Must be used inside the {@link bp_profile_fields()} template loop. 180 185 * 186 * @since 2.0.0 187 * 181 188 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. 182 * @param string $control_type Optional. HTML input type used to render the current field's child options.183 * @since 2.0.0189 * @param string $control_type Optional. HTML input type used to render the current 190 * field's child options. 184 191 */ 185 192 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
Note: See TracChangeset
for help on using the changeset viewer.