Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/01/2015 04:18:13 AM (11 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-selectbox.php

    r10142 r10163  
    11<?php
    22/**
    3  * BuddyPress XProfile Classes
     3 * BuddyPress XProfile Classes.
    44 *
    55 * @package BuddyPress
    … …  
    1818
    1919        /**
    20          * Constructor for the selectbox field type
     20         * Constructor for the selectbox field type.
    2121         *
    2222         * @since 2.0.0
    23          */
     23         */
    2424        public function __construct() {
    2525                parent::__construct();
    … …  
    4848         * Must be used inside the {@link bp_profile_fields()} template loop.
    4949         *
    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.
    5150         * @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.
    5255         */
    5356        public function edit_field_html( array $raw_properties = array() ) {
    5457
    55                 // user_id is a special optional parameter that we pass to
     58                // User_id is a special optional parameter that we pass to
    5659                // {@link bp_the_profile_field_options()}.
    5760                if ( isset( $raw_properties['user_id'] ) ) {
    … …  
    9295         * Must be used inside the {@link bp_profile_fields()} template loop.
    9396         *
     97         * @since 2.0.0
     98         *
    9499         * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
    95          * @since 2.0.0
    96100         */
    97101        public function edit_field_options_html( array $args = array() ) {
    … …  
    110114
    111115                        // Check for updated posted values, but errors preventing them from
    112                         // being saved first time
     116                        // being saved first time.
    113117                        foreach( $option_values as $i => $option_value ) {
    114118                                if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id] != $option_value ) {
    … …  
    120124
    121125                        // 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.
    123127                        $allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
    124128
    125                         // First, check to see whether the user-entered value matches
     129                        // First, check to see whether the user-entered value matches.
    126130                        if ( in_array( $allowed_options, $option_values ) ) {
    127131                                $selected = ' selected="selected"';
    128132                        }
    129133
    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.
    131135                        if ( ! is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option ) {
    132136                                $selected = ' selected="selected"';
    … …  
    155159         * Must be used inside the {@link bp_profile_fields()} template loop.
    156160         *
     161         * @since 2.0.0
     162         *
    157163         * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
    158          * @since 2.0.0
    159164         */
    160165        public function admin_field_html( array $raw_properties = array() ) {
    … …  
    173178         * Must be used inside the {@link bp_profile_fields()} template loop.
    174179         *
     180         * @since 2.0.0
     181         *
    175182         * @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.0
     183         * @param string            $control_type  Optional. HTML input type used to render the current
     184         *                                         field's child options.
    178185         */
    179186        public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
Note: See TracChangeset for help on using the changeset viewer.