- 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-datebox.php
r10140 r10163 18 18 19 19 /** 20 * Constructor for the datebox field type 21 * 22 * @since 2.0.0 23 */20 * Constructor for the datebox field type. 21 * 22 * @since 2.0.0 23 */ 24 24 public function __construct() { 25 25 parent::__construct(); … … 46 46 * Must be used inside the {@link bp_profile_fields()} template loop. 47 47 * 48 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.html permitted attributes} that you want to add. 49 * @since 2.0.0 48 * @since 2.0.0 49 * 50 * @param array $raw_properties Optional key/value array of 51 * {@link http://dev.w3.org/html5/markup/input.html permitted attributes} 52 * that you want to add. 50 53 */ 51 54 public function edit_field_html( array $raw_properties = array() ) { 52 55 53 // user_id is a special optional parameter that we pass to56 // User_id is a special optional parameter that we pass to. 54 57 // {@link bp_the_profile_field_options()}. 55 58 if ( isset( $raw_properties['user_id'] ) ) { … … 128 131 * Must be used inside the {@link bp_profile_fields()} template loop. 129 132 * 133 * @since 2.0.0 134 * 130 135 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. 131 * @since 2.0.0132 136 */ 133 137 public function edit_field_options_html( array $args = array() ) { … … 140 144 $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); 141 145 142 // Set day, month, year defaults 146 // Set day, month, year defaults. 143 147 if ( ! empty( $date ) ) { 144 148 145 // If Unix timestamp 149 // If Unix timestamp. 146 150 if ( is_numeric( $date ) ) { 147 151 $day = date( 'j', $date ); … … 149 153 $year = date( 'Y', $date ); 150 154 151 // If MySQL timestamp 155 // If MySQL timestamp. 152 156 } else { 153 157 $day = mysql2date( 'j', $date ); 154 $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below 158 $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below. 155 159 $year = mysql2date( 'Y', $date ); 156 160 } … … 179 183 } 180 184 181 // $type will be passed by calling function when needed 185 // $type will be passed by calling function when needed. 182 186 switch ( $args['type'] ) { 183 187 case 'day': … … 242 246 * Must be used inside the {@link bp_profile_fields()} template loop. 243 247 * 248 * @since 2.0.0 249 * 244 250 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. 245 * @since 2.0.0246 251 */ 247 252 public function admin_field_html( array $raw_properties = array() ) { … … 281 286 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. 282 287 * 288 * @since 2.0.0 289 * 283 290 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. 284 * @param string $control_type Optional. HTML input type used to render the current field's child options.285 * @since 2.0.0291 * @param string $control_type Optional. HTML input type used to render the current 292 * field's child options. 286 293 */ 287 294 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {} … … 293 300 * 294 301 * @param string $field_value The date value, as saved in the database. 295 * Typically, this is a MySQL-formatted date string (Y-m-d H:i:s). 302 * Typically, this is a MySQL-formatted date 303 * string (Y-m-d H:i:s). 304 * 296 305 * @return string Date formatted by bp_format_time(). 297 306 */ 298 307 public static function display_filter( $field_value ) { 299 308 300 // If Unix timestamp 309 // If Unix timestamp. 301 310 if ( ! is_numeric( $field_value ) ) { 302 311 $field_value = strtotime( $field_value );
Note: See TracChangeset
for help on using the changeset viewer.