Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/06/2015 06:52:22 AM (10 years ago)
Author:
tw2113
Message:

Adds hooks documentation to bp-xprofile-classes.php

Fixes #5949.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-classes.php

    r9179 r9304  
    5050        $this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id );
    5151
     52        /**
     53         * Fires before the current group instance gets saved.
     54         *
     55         * Please use this hook to filter the properties above. Each part will be passed in.
     56         *
     57         * @since BuddyPress (1.0.0)
     58         *
     59         * @param BP_XProfile_Group Current instance of the group being saved. Passed by reference.
     60         */
    5261        do_action_ref_array( 'xprofile_group_before_save', array( &$this ) );
    5362
     
    6473            $this->id = $wpdb->insert_id;
    6574
     75        /**
     76         * Fires after the current group instance gets saved.
     77         *
     78         * @since BuddyPress (1.0.0)
     79         *
     80         * @param BP_XProfile_Group Current instance of the group being saved. Passed by reference.
     81         */
    6682        do_action_ref_array( 'xprofile_group_after_save', array( &$this ) );
    6783
     
    7591            return false;
    7692
     93        /**
     94         * Fires before the current group instance gets deleted.
     95         *
     96         * @since BuddyPress (2.0.0)
     97         *
     98         * @param BP_XProfile_Group Current instance of the group being deleted. Passed by reference.
     99         */
    77100        do_action_ref_array( 'xprofile_group_before_delete', array( &$this ) );
    78101
     
    91114            }
    92115
     116            /**
     117             * Fires after the current group instance gets deleted.
     118             *
     119             * @since BuddyPress (2.0.0)
     120             *
     121             * @param BP_XProfile_Group Current instance of the group being deleted. Passed by reference.
     122             */
    93123            do_action_ref_array( 'xprofile_group_after_delete', array( &$this ) );
    94124
     
    401431     * Fetch the field visibility level for the fields returned by the query
    402432     *
    403      * @since BuddyPress (1.6)
     433     * @since BuddyPress (1.6.0)
    404434     *
    405435     * @param int $user_id The profile owner's user_id
     
    424454            } else {
    425455                $fallback_visibility = bp_xprofile_get_meta( $field->id, 'field', 'default_visibility' );
     456
     457                /**
     458                 * Filters the XProfile default visibility level for a field.
     459                 *
     460                 * @since BuddyPress (1.6.0)
     461                 *
     462                 * @param string $value Default visibility value.
     463                 */
    426464                $field_visibility = ! empty( $fallback_visibility ) ? $fallback_visibility : apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
    427465            }
     
    518556
    519557                                <?php
     558
    520559                                /**
    521560                                 * Fires before XProfile Group submit metabox.
     
    535574
    536575                                                <?php
     576
    537577                                                /**
    538578                                                 * Fires at the beginning of the XProfile Group publishing actions section.
     
    559599
    560600                                <?php
     601
    561602                                /**
    562603                                 * Fires after XProfile Group submit metabox.
     
    691732        $this->type_obj    = bp_xprofile_create_field_type( $this->type );
    692733
     734        /**
     735         * Fires before the current field instance gets saved.
     736         *
     737         * Please use this hook to filter the properties above. Each part will be passed in.
     738         *
     739         * @since BuddyPress (1.0.0)
     740         *
     741         * @param BP_XProfile_Field Current instance of the field being saved.
     742         */
    693743        do_action_ref_array( 'xprofile_field_before_save', array( $this ) );
    694744
     
    738788                $post_option  = ! empty( $_POST["{$this->type}_option"] ) ? $_POST["{$this->type}_option"] : '';
    739789                $post_default = ! empty( $_POST["isDefault_{$this->type}_option"] ) ? $_POST["isDefault_{$this->type}_option"] : '';
     790
     791                /**
     792                 * Filters the submitted field option value before saved.
     793                 *
     794                 * @since BuddyPress (1.5.0)
     795                 *
     796                 * @param string            $post_option Submitted option value.
     797                 * @param BP_XProfile_Field $type        Current field type being saved for.
     798                 */
    740799                $options      = apply_filters( 'xprofile_field_options_before_save', $post_option,  $this->type );
     800
     801                /**
     802                 * Filters the default field option value before saved.
     803                 *
     804                 * @since BuddyPress (1.5.0)
     805                 *
     806                 * @param string            $post_default Default option value.
     807                 * @param BP_XProfile_Field $type         Current field type being saved for.
     808                 */
    741809                $defaults     = apply_filters( 'xprofile_field_default_before_save', $post_default, $this->type );
    742810
     
    765833            }
    766834
     835            /**
     836             * Fires after the current field instance gets saved.
     837             *
     838             * @since BuddyPress (1.0.0)
     839             *
     840             * @param BP_XProfile_Field Current instance of the field being saved.
     841             */
    767842            do_action_ref_array( 'xprofile_field_after_save', array( $this ) );
    768843
     
    804879        $children = $wpdb->get_results( $sql );
    805880
     881        /**
     882         * Filters the found children for a field.
     883         *
     884         * @since BuddyPress (1.2.5)
     885         *
     886         * @param object $children    Found children for a field.
     887         * @param bool   $for_editing Whether or not the field is for editing.
     888         */
    806889        return apply_filters( 'bp_xprofile_field_get_children', $children, $for_editing );
    807890    }
     
    9371020
    9381021                            <?php
     1022
    9391023                            /**
    9401024                             * Fires before XProfile Field submit metabox.
     
    9541038
    9551039                                            <?php
     1040
    9561041                                            /**
    9571042                                             * Fires at the beginning of the XProfile Field publishing actions section.
     
    9791064
    9801065                            <?php
     1066
    9811067                            /**
    9821068                             * Fires after XProfile Field submit metabox.
     
    10281114                            <?php endif ?>
    10291115
    1030                             <?php do_action( 'xprofile_field_after_sidebarbox', $this ); ?>
     1116                            <?php
     1117
     1118                            /**
     1119                             * Fires after XProfile Field sidebar metabox.
     1120                             *
     1121                             * @since BuddyPress (2.2.0)
     1122                             *
     1123                             * @param BP_XProfile_Field $this Current XProfile field.
     1124                             */
     1125                            do_action( 'xprofile_field_after_sidebarbox', $this ); ?>
    10311126                        </div>
    10321127
     
    10691164                            <?php endif; ?>
    10701165
    1071                             <?php do_action( 'xprofile_field_after_contentbox', $this ); ?>
     1166                            <?php
     1167
     1168                            /**
     1169                             * Fires after XProfile Field content metabox.
     1170                             *
     1171                             * @since BuddyPress (2.2.0)
     1172                             *
     1173                             * @param BP_XProfile_Field $this Current XProfile field.
     1174                             */
     1175                            do_action( 'xprofile_field_after_contentbox', $this ); ?>
    10721176                        </div>
    10731177                    </div><!-- #post-body -->
     
    11641268        }
    11651269
     1270        /**
     1271         * Filters whether or not data already exists for the user.
     1272         *
     1273         * @since BuddyPress (1.2.7)
     1274         *
     1275         * @param bool                    $retval Whether or not data already exists.
     1276         * @param BP_XProfile_ProfileData $this   Instance of the current BP_XProfile_ProfileData class.
     1277         */
    11661278        return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );
    11671279    }
     
    11791291        $retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d", $this->field_id ) );
    11801292
     1293        /**
     1294         * Filters whether or not data is for a valid field
     1295         *
     1296         * @since BuddyPress (1.2.7)
     1297         *
     1298         * @param bool                    $retval Whether or not data is valid.
     1299         * @param BP_XProfile_ProfileData $this   Instance of the current BP_XProfile_ProfileData class.
     1300         */
    11811301        return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) );
    11821302    }
     
    11901310        $this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', bp_core_current_time(), $this->id );
    11911311
     1312        /**
     1313         * Fires before the current profile data instance gets saved.
     1314         *
     1315         * Please use this hook to filter the properties above. Each part will be passed in.
     1316         *
     1317         * @since BuddyPress (1.0.0)
     1318         *
     1319         * @param BP_XProfile_ProfileData $this Current instance of the profile data being saved.
     1320         */
    11921321        do_action_ref_array( 'xprofile_data_before_save', array( $this ) );
    11931322
     
    12081337                return false;
    12091338
     1339            /**
     1340             * Fires after the current profile data instance gets saved.
     1341             *
     1342             * @since BuddyPress (1.0.0)
     1343             *
     1344             * @param BP_XProfile_ProfileData $this Current instance of the profile data being saved.
     1345             */
    12101346            do_action_ref_array( 'xprofile_data_after_save', array( $this ) );
    12111347
     
    12271363        $bp = buddypress();
    12281364
     1365        /**
     1366         * Fires before the current profile data instance gets deleted.
     1367         *
     1368         * @since BuddyPress (1.9.0)
     1369         *
     1370         * @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted.
     1371         */
    12291372        do_action_ref_array( 'xprofile_data_before_delete', array( $this ) );
    12301373
     
    12321375            return false;
    12331376
     1377        /**
     1378         * Fires after the current profile data instance gets deleted.
     1379         *
     1380         * @since BuddyPress (1.9.0)
     1381         *
     1382         * @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted.
     1383         */
    12341384        do_action_ref_array( 'xprofile_data_after_delete', array( $this ) );
    12351385
     
    15671717        $this->set_format( '/^\d{4}-\d{1,2}-\d{1,2} 00:00:00$/', 'replace' ); // "Y-m-d 00:00:00"
    15681718
     1719        /**
     1720         * Fires inside __construct() method for BP_XProfile_Field_Type_Datebox class.
     1721         *
     1722         * @since BuddyPress (2.0.0)
     1723         *
     1724         * @param BP_XProfile_Field_Type_Datebox $this Current instance of
     1725         *                                             the field type datebox.
     1726         */
    15691727        do_action( 'bp_xprofile_field_type_datebox', $this );
    15701728    }
     
    16071765
    16081766            <label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    1609             <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     1767            <?php
     1768
     1769            /**
     1770             * Fires after field label and displays associated errors for the field.
     1771             *
     1772             * This is a dynamic hook that is dependent on the associated
     1773             * field ID. The hooks will be similar to `bp_field_12_errors`
     1774             * where the 12 is the field ID. Simply replace the 12 with
     1775             * your needed target ID.
     1776             *
     1777             * @since BuddyPress (1.8.0)
     1778             */
     1779            do_action( bp_get_the_profile_field_errors_action() ); ?>
    16101780
    16111781            <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
     
    17381908        }
    17391909
     1910        /**
     1911         * Filters the output for the profile field datebox.
     1912         *
     1913         * @since BuddyPress (1.1.0)
     1914         *
     1915         * @param string $html  HTML output for the field.
     1916         * @param string $value Which date type is being rendered for.
     1917         * @param string $day   Date formatted for the current day.
     1918         * @param string $month Date formatted for the current month.
     1919         * @param string $year  Date formatted for the current year.
     1920         * @param int    $id    ID of the field object being rendered.
     1921         * @param string $date  Current date.
     1922         */
    17401923        echo apply_filters( 'bp_get_the_profile_field_datebox', $html, $args['type'], $day, $month, $year, $this->field_obj->id, $date );
    17411924    }
     
    18342017
    18352018        $this->set_format( '/^.+$/', 'replace' );
     2019
     2020        /**
     2021         * Fires inside __construct() method for BP_XProfile_Field_Type_Checkbox class.
     2022         *
     2023         * @since BuddyPress (2.0.0)
     2024         *
     2025         * @param BP_XProfile_Field_Type_Checkbox $this Current instance of
     2026         *                                              the field type checkbox.
     2027         */
    18362028        do_action( 'bp_xprofile_field_type_checkbox', $this );
    18372029    }
     
    18642056            </label>
    18652057
    1866             <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2058            <?php
     2059
     2060            /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2061            do_action( bp_get_the_profile_field_errors_action() ); ?>
    18672062
    18682063            <?php bp_the_profile_field_options( array(
     
    19332128                esc_html( stripslashes( $options[$k]->name ) )
    19342129            );
     2130
     2131            /**
     2132             * Filters the HTML output for an individual field options checkbox.
     2133             *
     2134             * @since BuddyPress (1.1.0)
     2135             *
     2136             * @param string $new_html Label and checkbox input field.
     2137             * @param object $value    Current option being rendered for.
     2138             * @param int    $id       ID of the field object being rendered.
     2139             * @param string $selected Current selected value.
     2140             * @param string $k        Current index in the foreach loop.
     2141             */
    19352142            $html .= apply_filters( 'bp_get_the_profile_field_options_checkbox', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
    19362143        }
     
    19862193
    19872194        $this->set_format( '/^.+$/', 'replace' );
     2195
     2196        /**
     2197         * Fires inside __construct() method for BP_XProfile_Field_Type_Radiobutton class.
     2198         *
     2199         * @since BuddyPress (2.0.0)
     2200         *
     2201         * @param BP_XProfile_Field_Type_Radiobutton $this Current instance of
     2202         *                                                 the field type radio button.
     2203         */
    19882204        do_action( 'bp_xprofile_field_type_radiobutton', $this );
    19892205    }
     
    20172233            </label>
    20182234
    2019             <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2235            <?php
     2236
     2237            /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2238            do_action( bp_get_the_profile_field_errors_action() ); ?>
    20202239
    20212240            <?php bp_the_profile_field_options( array( 'user_id' => $user_id ) );
     
    20802299                esc_html( stripslashes( $options[$k]->name ) )
    20812300            );
     2301
     2302            /**
     2303             * Filters the HTML output for an individual field options radio button.
     2304             *
     2305             * @since BuddyPress (1.1.0)
     2306             *
     2307             * @param string $new_html Label and radio input field.
     2308             * @param object $value    Current option being rendered for.
     2309             * @param int    $id       ID of the field object being rendered.
     2310             * @param string $selected Current selected value.
     2311             * @param string $k        Current index in the foreach loop.
     2312             */
    20822313            $html .= apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
    20832314        }
     
    21452376
    21462377        $this->set_format( '/^.+$/', 'replace' );
     2378
     2379        /**
     2380         * Fires inside __construct() method for BP_XProfile_Field_Type_Multiselectbox class.
     2381         *
     2382         * @since BuddyPress (2.0.0)
     2383         *
     2384         * @param BP_XProfile_Field_Type_Multiselectbox $this Current instance of
     2385         *                                                    the field type multiple select box.
     2386         */
    21472387        do_action( 'bp_xprofile_field_type_multiselectbox', $this );
    21482388    }
     
    21752415        <label for="<?php bp_the_profile_field_input_name(); ?>[]"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
    21762416
    2177         <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2417        <?php
     2418
     2419        /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2420        do_action( bp_get_the_profile_field_errors_action() ); ?>
    21782421
    21792422        <select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
     
    22452488            }
    22462489
     2490            /**
     2491             * Filters the HTML output for options in a multiselect input.
     2492             *
     2493             * @since BuddyPress (1.5.0)
     2494             *
     2495             * @param string $value    Option tag for current value being rendered.
     2496             * @param object $value    Current option being rendered for.
     2497             * @param int    $id       ID of the field object being rendered.
     2498             * @param string $selected Current selected value.
     2499             * @param string $k        Current index in the foreach loop.
     2500             */
    22472501            $html .= apply_filters( 'bp_get_the_profile_field_options_multiselect', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_html( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $this->field_obj->id, $selected, $k );
    22482502        }
     
    23062560
    23072561        $this->set_format( '/^.+$/', 'replace' );
     2562
     2563        /**
     2564         * Fires inside __construct() method for BP_XProfile_Field_Type_Selectbox class.
     2565         *
     2566         * @since BuddyPress (2.0.0)
     2567         *
     2568         * @param BP_XProfile_Field_Type_Selectbox $this Current instance of
     2569         *                                               the field type select box.
     2570         */
    23082571        do_action( 'bp_xprofile_field_type_selectbox', $this );
    23092572    }
     
    23352598        </label>
    23362599
    2337         <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2600        <?php
     2601
     2602        /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2603        do_action( bp_get_the_profile_field_errors_action() ); ?>
    23382604
    23392605        <select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
     
    23962662            }
    23972663
     2664            /**
     2665             * Filters the HTML output for options in a select input.
     2666             *
     2667             * @since BuddyPress (1.1.0)
     2668             *
     2669             * @param string $value    Option tag for current value being rendered.
     2670             * @param object $value    Current option being rendered for.
     2671             * @param int    $id       ID of the field object being rendered.
     2672             * @param string $selected Current selected value.
     2673             * @param string $k        Current index in the foreach loop.
     2674             */
    23982675            $html .= apply_filters( 'bp_get_the_profile_field_options_select', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_html( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $this->field_obj->id, $selected, $k );
    23992676        }
     
    24532730
    24542731        $this->set_format( '/^.*$/m', 'replace' );
     2732
     2733        /**
     2734         * Fires inside __construct() method for BP_XProfile_Field_Type_Textarea class.
     2735         *
     2736         * @since BuddyPress (2.0.0)
     2737         *
     2738         * @param BP_XProfile_Field_Type_Textarea $this Current instance of
     2739         *                                              the field type textarea.
     2740         */
    24552741        do_action( 'bp_xprofile_field_type_textarea', $this );
    24562742    }
     
    24842770        </label>
    24852771
    2486         <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2772        <?php
     2773
     2774        /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2775        do_action( bp_get_the_profile_field_errors_action() ); ?>
    24872776
    24882777        <textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>><?php bp_the_profile_field_edit_value(); ?></textarea>
     
    25402829
    25412830        $this->set_format( '/^.*$/', 'replace' );
     2831
     2832        /**
     2833         * Fires inside __construct() method for BP_XProfile_Field_Type_Textbox class.
     2834         *
     2835         * @since BuddyPress (2.0.0)
     2836         *
     2837         * @param BP_XProfile_Field_Type_Textbox $this Current instance of
     2838         *                                             the field type text box.
     2839         */
    25422840        do_action( 'bp_xprofile_field_type_textbox', $this );
    25432841    }
     
    25712869        </label>
    25722870
    2573         <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2871        <?php
     2872
     2873        /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2874        do_action( bp_get_the_profile_field_errors_action() ); ?>
    25742875
    25752876        <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
     
    26272928
    26282929        $this->set_format( '/^\d+|-\d+$/', 'replace' );
     2930
     2931        /**
     2932         * Fires inside __construct() method for BP_XProfile_Field_Type_Number class.
     2933         *
     2934         * @since BuddyPress (2.0.0)
     2935         *
     2936         * @param BP_XProfile_Field_Type_Number $this Current instance of
     2937         *                                            the field type number.
     2938         */
    26292939        do_action( 'bp_xprofile_field_type_number', $this );
    26302940    }
     
    26582968        </label>
    26592969
    2660         <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     2970        <?php
     2971
     2972        /** This action is documented in bp-xprofile/bp-xprofile-classes */
     2973        do_action( bp_get_the_profile_field_errors_action() ); ?>
    26612974
    26622975        <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
     
    27133026        $this->set_format( '_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS', 'replace' );
    27143027
     3028        /**
     3029         * Fires inside __construct() method for BP_XProfile_Field_Type_URL class.
     3030         *
     3031         * @since BuddyPress (2.0.0)
     3032         *
     3033         * @param BP_XProfile_Field_Type_URL $this Current instance of
     3034         *                                         the field type URL.
     3035         */
    27153036        do_action( 'bp_xprofile_field_type_url', $this );
    27163037    }
     
    27473068        </label>
    27483069
    2749         <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
     3070        <?php
     3071
     3072        /** This action is documented in bp-xprofile/bp-xprofile-classes */
     3073        do_action( bp_get_the_profile_field_errors_action() ); ?>
    27503074
    27513075        <input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
     
    29463270     */
    29473271    public function __construct() {
     3272
     3273        /**
     3274         * Fires inside __construct() method for BP_XProfile_Field_Type class.
     3275         *
     3276         * @since BuddyPress (2.0.0)
     3277         *
     3278         * @param BP_XProfile_Field_Type $this Current instance of
     3279         *                                     the field type class.
     3280         */
    29483281        do_action( 'bp_xprofile_field_type', $this );
    29493282    }
     
    29623295    public function set_format( $format, $replace_format = 'add' ) {
    29633296
     3297        /**
     3298         * Filters the regex format for the field type.
     3299         *
     3300         * @since BuddyPress (2.0.0)
     3301         *
     3302         * @param string                 $format         Regex string.
     3303         * @param string                 $replace_format Optional replace format If "replace", replaces the
     3304         *                                               format instead of adding to it. Defaults to "add".
     3305         * @param BP_XProfile_Field_Type $this           Current instance of the BP_XProfile_Field_Type class.
     3306         */
    29643307        $format = apply_filters( 'bp_xprofile_field_type_set_format', $format, $replace_format, $this );
    29653308
     
    29743317
    29753318    /**
    2976      * Add a value to this type's whitelist that that profile data will be asserted against.
     3319     * Add a value to this type's whitelist that profile data will be asserted against.
    29773320     *
    29783321     * You can call this method multiple times to set multiple formats. When validation is performed,
     
    29853328    public function set_whitelist_values( $values ) {
    29863329        foreach ( (array) $values as $value ) {
     3330
     3331            /**
     3332             * Filters values for field type's whitelist that profile data will be asserted against.
     3333             *
     3334             * @since BuddyPress (2.0.0)
     3335             *
     3336             * @param string                 $value  Field value.
     3337             * @param array                  $values Original array of values.
     3338             * @param BP_XProfile_Field_Type $this   Current instance of the BP_XProfile_Field_Type class.
     3339             */
    29873340            $this->validation_whitelist[] = apply_filters( 'bp_xprofile_field_type_set_whitelist_values', $value, $values, $this );
    29883341        }
     
    30303383        }
    30313384
     3385        /**
     3386         * Filters whether or not field type is a valid format.
     3387         *
     3388         * @since BuddyPress (2.0.0)
     3389         *
     3390         * @param bool                   $validated Whether or not the field type is valid.
     3391         * @param string|array           $values    Value to check against the registered formats.
     3392         * @param BP_XProfile_Field_Type $this      Current instance of the BP_XProfile_Field_Type class.
     3393         */
    30323394        return (bool) apply_filters( 'bp_xprofile_field_type_is_valid', $validated, $values, $this );
    30333395    }
     
    32543616
    32553617        $html = '';
     3618
     3619        /**
     3620         * Filters the edit html elements and attributes.
     3621         *
     3622         * @since BuddyPress (2.0.0)
     3623         *
     3624         * @param array  $r     Array of parsed arguments.
     3625         * @param string $value Class name for the current class instance.
     3626         */
    32563627        $r    = (array) apply_filters( 'bp_xprofile_field_edit_html_elements', $r, get_class( $this ) );
    32573628
Note: See TracChangeset for help on using the changeset viewer.