Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/01/2015 04:18:13 AM (10 years ago)
Author:
tw2113
Message:

First pass of documentation cleanup for the XProfile Component.

See #6406.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    r10140 r10163  
    1818
    1919    /**
    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     */
    2424    public function __construct() {
    2525        parent::__construct();
     
    4646     * Must be used inside the {@link bp_profile_fields()} template loop.
    4747     *
    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.
    5053     */
    5154    public function edit_field_html( array $raw_properties = array() ) {
    5255
    53         // user_id is a special optional parameter that we pass to
     56        // User_id is a special optional parameter that we pass to.
    5457        // {@link bp_the_profile_field_options()}.
    5558        if ( isset( $raw_properties['user_id'] ) ) {
     
    128131     * Must be used inside the {@link bp_profile_fields()} template loop.
    129132     *
     133     * @since 2.0.0
     134     *
    130135     * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
    131      * @since 2.0.0
    132136     */
    133137    public function edit_field_options_html( array $args = array() ) {
     
    140144        $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
    141145
    142         // Set day, month, year defaults
     146        // Set day, month, year defaults.
    143147        if ( ! empty( $date ) ) {
    144148
    145             // If Unix timestamp
     149            // If Unix timestamp.
    146150            if ( is_numeric( $date ) ) {
    147151                $day   = date( 'j', $date );
     
    149153                $year  = date( 'Y', $date );
    150154
    151             // If MySQL timestamp
     155            // If MySQL timestamp.
    152156            } else {
    153157                $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.
    155159                $year  = mysql2date( 'Y', $date );
    156160            }
     
    179183        }
    180184
    181         // $type will be passed by calling function when needed
     185        // $type will be passed by calling function when needed.
    182186        switch ( $args['type'] ) {
    183187            case 'day':
     
    242246     * Must be used inside the {@link bp_profile_fields()} template loop.
    243247     *
     248     * @since 2.0.0
     249     *
    244250     * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
    245      * @since 2.0.0
    246251     */
    247252    public function admin_field_html( array $raw_properties = array() ) {
     
    281286     * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
    282287     *
     288     * @since 2.0.0
     289     *
    283290     * @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.0
     291     * @param string            $control_type  Optional. HTML input type used to render the current
     292     *                                         field's child options.
    286293     */
    287294    public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
     
    293300     *
    294301     * @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     *
    296305     * @return string Date formatted by bp_format_time().
    297306     */
    298307    public static function display_filter( $field_value ) {
    299308
    300         // If Unix timestamp
     309        // If Unix timestamp.
    301310        if ( ! is_numeric( $field_value ) ) {
    302311            $field_value = strtotime( $field_value );
Note: See TracChangeset for help on using the changeset viewer.