diff --git bp-xprofile/bp-xprofile-admin.php bp-xprofile/bp-xprofile-admin.php
index 95151ea..d719563 100644
|
|
|
function xprofile_admin_manage_field( $group_id, $field_id = null ) {
|
| 247 | 247 | $field->is_required = wp_filter_kses( $_POST['required'] ); |
| 248 | 248 | $field->type = wp_filter_kses( $_POST['fieldtype'] ); |
| 249 | 249 | |
| | 250 | $field->placeholder = wp_filter_kses( $_POST["placeholder_text_{$field->type}"] ); |
| | 251 | |
| 250 | 252 | if ( !empty( $_POST["sort_order_{$field->type}"] ) ) |
| 251 | 253 | $field->order_by = wp_filter_kses( $_POST["sort_order_{$field->type}"] ); |
| 252 | 254 | |
| … |
… |
function xprofile_admin_manage_field( $group_id, $field_id = null ) {
|
| 283 | 285 | bp_xprofile_update_field_meta( $field_id, 'allow_custom_visibility', $_POST['allow-custom-visibility'] ); |
| 284 | 286 | } |
| 285 | 287 | |
| | 288 | bp_xprofile_update_field_meta( $field_id, 'placeholder', $_POST["placeholder_text_{$field->type}"] ); |
| | 289 | |
| 286 | 290 | unset( $_GET['mode'] ); |
| 287 | 291 | |
| 288 | 292 | do_action( 'xprofile_fields_saved_field', $field ); |
diff --git bp-xprofile/bp-xprofile-classes.php bp-xprofile/bp-xprofile-classes.php
index 84df571..a7814fd 100644
|
|
|
class BP_XProfile_Field {
|
| 478 | 478 | $this->data = $this->get_field_data( $user_id ); |
| 479 | 479 | } |
| 480 | 480 | |
| | 481 | $this->placeholder = bp_xprofile_get_meta( $id, 'field', 'placeholder' ); |
| | 482 | |
| 481 | 483 | $this->default_visibility = bp_xprofile_get_meta( $id, 'field', 'default_visibility' ); |
| 482 | 484 | |
| 483 | 485 | if ( empty( $this->default_visibility ) ) { |
| … |
… |
class BP_XProfile_Field {
|
| 519 | 521 | $this->order_by = apply_filters( 'xprofile_field_order_by_before_save', $this->order_by, $this->id ); |
| 520 | 522 | $this->field_order = apply_filters( 'xprofile_field_field_order_before_save', $this->field_order, $this->id ); |
| 521 | 523 | $this->can_delete = apply_filters( 'xprofile_field_can_delete_before_save', $this->can_delete, $this->id ); |
| | 524 | $this->placeholder = apply_filters( 'xprofile_field_placeholder_before_save', $this->placeholder, $this->id ); |
| 522 | 525 | |
| 523 | 526 | do_action_ref_array( 'xprofile_field_before_save', array( $this ) ); |
| 524 | 527 | |
| … |
… |
class BP_XProfile_Field {
|
| 617 | 620 | } |
| 618 | 621 | } |
| 619 | 622 | |
| | 623 | bp_xprofile_update_field_meta( $field_id, 'placeholder', $field->placeholder); |
| | 624 | |
| 620 | 625 | do_action_ref_array( 'xprofile_field_after_save', array( $this ) ); |
| 621 | 626 | |
| 622 | 627 | return $field_id; |
| … |
… |
class BP_XProfile_Field {
|
| 748 | 753 | $this->default_visibility = 'public'; |
| 749 | 754 | } |
| 750 | 755 | |
| | 756 | $placeholder = ! empty( $this->placeholder ) ? $this->placeholder : __( '----', 'buddypress' ); |
| | 757 | |
| 751 | 758 | ?> |
| 752 | 759 | |
| 753 | 760 | <div id="<?php echo esc_attr( $type ); ?>" class="postbox bp-options-box" style="<?php echo esc_attr( $class ); ?> margin-top: 15px;"> |
| 754 | 761 | <h3><?php _e( 'Please enter options for this Field:', 'buddypress' ); ?></h3> |
| 755 | 762 | <div class="inside"> |
| 756 | 763 | <p> |
| | 764 | <label for="placeholder_text_<?php echo esc_attr( $type ); ?>"><?php _e( 'Placeholder text:', 'buddypress' ); ?></label> |
| | 765 | <input type="text" name="placeholder_text_<?php echo esc_attr( $type ); ?>" id="placeholder_text_<?php echo esc_attr( $type ); ?>" value="<?php echo esc_attr( $placeholder ) ?>" /> |
| | 766 | </p> |
| | 767 | <p> |
| 757 | 768 | <label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php _e( 'Sort Order:', 'buddypress' ); ?></label> |
| 758 | 769 | <select name="sort_order_<?php echo esc_attr( $type ); ?>" id="sort_order_<?php echo esc_attr( $type ); ?>" > |
| 759 | 770 | <option value="custom" <?php selected( 'custom', $this->order_by ); ?>><?php _e( 'Custom', 'buddypress' ); ?></option> |
| … |
… |
class BP_XProfile_Field {
|
| 828 | 839 | $this->description = $_POST['description']; |
| 829 | 840 | $this->is_required = $_POST['required']; |
| 830 | 841 | $this->type = $_POST['fieldtype']; |
| | 842 | $this->placeholder = $_POST["placeholder_{$this->type}"]; |
| 831 | 843 | $this->order_by = $_POST["sort_order_{$this->type}"]; |
| 832 | 844 | $this->field_order = $_POST['field_order']; |
| 833 | 845 | } |
diff --git bp-xprofile/bp-xprofile-template.php bp-xprofile/bp-xprofile-template.php
index a82db1c..ab2af1a 100644
|
|
|
function bp_get_the_profile_field_errors_action() {
|
| 420 | 420 | function bp_the_profile_field_options( $args = '' ) { |
| 421 | 421 | echo bp_get_the_profile_field_options( $args ); |
| 422 | 422 | } |
| | 423 | |
| | 424 | function bp_get_placeholder_text_for_field( $field ) { |
| | 425 | if ($field->placeholder) { |
| | 426 | return $field->placeholder; |
| | 427 | } else { |
| | 428 | return /* translators: no option picked in select box */ __( '----', 'buddypress' ) ; |
| | 429 | } |
| | 430 | } |
| | 431 | |
| 423 | 432 | /** |
| 424 | 433 | * bp_get_the_profile_field_options() |
| 425 | 434 | * |
| … |
… |
function bp_the_profile_field_options( $args = '' ) {
|
| 468 | 477 | switch ( $field->type ) { |
| 469 | 478 | case 'selectbox': |
| 470 | 479 | |
| 471 | | $html .= '<option value="">' . /* translators: no option picked in select box */ __( '----', 'buddypress' ) . '</option>'; |
| | 480 | $html .= '<option value="">' . esc_html( bp_get_placeholder_text_for_field($field) ) . '</option>'; |
| 472 | 481 | |
| 473 | 482 | $original_option_values = ''; |
| 474 | 483 | $original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field->id ) ); |