- Timestamp:
- 10/01/2015 04:18:13 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php
r10140 r10163 18 18 19 19 /** 20 * Constructor for the multi-selectbox field type 21 * 22 * @since 2.0.0 23 */20 * Constructor for the multi-selectbox field type. 21 * 22 * @since 2.0.0 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/select.html permitted attributes} that you want to add. 53 * @since 2.0.0 52 * @since 2.0.0 53 * 54 * @param array $raw_properties Optional key/value array of 55 * {@link http://dev.w3.org/html5/markup/select.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'] ) ) { … … 104 107 * Must be used inside the {@link bp_profile_fields()} template loop. 105 108 * 109 * @since 2.0.0 110 * 106 111 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. 107 * @since 2.0.0108 112 */ 109 113 public function edit_field_options_html( array $args = array() ) { … … 122 126 123 127 // Check for updated posted values, but errors preventing them from 124 // being saved first time 128 // being saved first time. 125 129 foreach( $option_values as $i => $option_value ) { 126 130 if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id][$i] != $option_value ) { … … 132 136 133 137 // Run the allowed option name through the before_save filter, so 134 // we'll be sure to get a match 138 // we'll be sure to get a match. 135 139 $allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false ); 136 140 137 // First, check to see whether the user-entered value matches 141 // First, check to see whether the user-entered value matches. 138 142 if ( in_array( $allowed_options, $option_values ) ) { 139 143 $selected = ' selected="selected"'; 140 144 } 141 145 142 // Then, if the user has not provided a value, check for defaults 146 // Then, if the user has not provided a value, check for defaults. 143 147 if ( ! is_array( $original_option_values ) && empty( $option_values ) && ! empty( $options[$k]->is_default_option ) ) { 144 148 $selected = ' selected="selected"'; … … 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() ) { … … 183 188 184 189 /** 185 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens. 186 * 187 * Must be used inside the {@link bp_profile_fields()} template loop. 190 * Output HTML for this field type's children options on the wp-admin Profile Fields, 191 * "Add Field" and "Edit Field" screens. 192 * 193 * Must be used inside the {@link bp_profile_fields()} template loop. 194 * 195 * @since 2.0.0 188 196 * 189 197 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. 190 * @param string $control_type Optional. HTML input type used to render the current field's child options.191 * @since 2.0.0198 * @param string $control_type Optional. HTML input type used to render the current 199 * field's child options. 192 200 */ 193 201 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
Note: See TracChangeset
for help on using the changeset viewer.