- 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-selectbox.php
r10142 r10163 1 1 <?php 2 2 /** 3 * BuddyPress XProfile Classes 3 * BuddyPress XProfile Classes. 4 4 * 5 5 * @package BuddyPress … … 18 18 19 19 /** 20 * Constructor for the selectbox field type 20 * Constructor for the selectbox field type. 21 21 * 22 22 * @since 2.0.0 23 23 */ 24 24 public function __construct() { 25 25 parent::__construct(); … … 48 48 * Must be used inside the {@link bp_profile_fields()} template loop. 49 49 * 50 * @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.51 50 * @since 2.0.0 51 * 52 * @param array $raw_properties Optional key/value array of 53 * {@link http://dev.w3.org/html5/markup/select.html permitted attributes} 54 * that you want to add. 52 55 */ 53 56 public function edit_field_html( array $raw_properties = array() ) { 54 57 55 // user_id is a special optional parameter that we pass to58 // User_id is a special optional parameter that we pass to 56 59 // {@link bp_the_profile_field_options()}. 57 60 if ( isset( $raw_properties['user_id'] ) ) { … … 92 95 * Must be used inside the {@link bp_profile_fields()} template loop. 93 96 * 97 * @since 2.0.0 98 * 94 99 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. 95 * @since 2.0.096 100 */ 97 101 public function edit_field_options_html( array $args = array() ) { … … 110 114 111 115 // Check for updated posted values, but errors preventing them from 112 // being saved first time 116 // being saved first time. 113 117 foreach( $option_values as $i => $option_value ) { 114 118 if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id] != $option_value ) { … … 120 124 121 125 // Run the allowed option name through the before_save filter, so 122 // we'll be sure to get a match 126 // we'll be sure to get a match. 123 127 $allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false ); 124 128 125 // First, check to see whether the user-entered value matches 129 // First, check to see whether the user-entered value matches. 126 130 if ( in_array( $allowed_options, $option_values ) ) { 127 131 $selected = ' selected="selected"'; 128 132 } 129 133 130 // Then, if the user has not provided a value, check for defaults 134 // Then, if the user has not provided a value, check for defaults. 131 135 if ( ! is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option ) { 132 136 $selected = ' selected="selected"'; … … 155 159 * Must be used inside the {@link bp_profile_fields()} template loop. 156 160 * 161 * @since 2.0.0 162 * 157 163 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. 158 * @since 2.0.0159 164 */ 160 165 public function admin_field_html( array $raw_properties = array() ) { … … 173 178 * Must be used inside the {@link bp_profile_fields()} template loop. 174 179 * 180 * @since 2.0.0 181 * 175 182 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. 176 * @param string $control_type Optional. HTML input type used to render the current field's child options.177 * @since 2.0.0183 * @param string $control_type Optional. HTML input type used to render the current 184 * field's child options. 178 185 */ 179 186 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
Note: See TracChangeset
for help on using the changeset viewer.