Skip to:
Content

BuddyPress.org

Ticket #5184: 0001-Add-a-function-to-return-the-placeholder-text.patch

File 0001-Add-a-function-to-return-the-placeholder-text.patch, 1.5 KB (added by haykayltduk, 10 years ago)

factor the string into a function

  • bp-xprofile/bp-xprofile-template.php

    From 7c76e907463ff92ab17f1f52017a993360163f3a Mon Sep 17 00:00:00 2001
    From: Anand Kumria <akumria@acm.org>
    Date: Sun, 24 Nov 2013 15:34:50 +0000
    Subject: [PATCH 1/4] Add a function to return the placeholder text.
    
    Moving this to a function means we can, in future, pull the placeholder
    text from the DB.
    ---
     bp-xprofile/bp-xprofile-template.php |    7 ++++++-
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    diff --git a/bp-xprofile/bp-xprofile-template.php b/bp-xprofile/bp-xprofile-template.php
    index a82db1c..99d4a43 100644
    a b function bp_get_the_profile_field_errors_action() { 
    420420function bp_the_profile_field_options( $args = '' ) {
    421421        echo bp_get_the_profile_field_options( $args );
    422422}
     423
     424function bp_get_placeholder_text_for_field( $field ) {
     425    return /* translators: no option picked in select box */ __( '----', 'buddypress' ) ;
     426}
     427
    423428        /**
    424429         * bp_get_the_profile_field_options()
    425430         *
    function bp_the_profile_field_options( $args = '' ) { 
    468473                switch ( $field->type ) {
    469474                        case 'selectbox':
    470475
    471                                 $html .= '<option value="">' . /* translators: no option picked in select box */ __( '----', 'buddypress' ) . '</option>';
     476                                $html .= '<option value="">' . bp_get_placeholder_text_for_field($field) . '</option>';
    472477
    473478                                $original_option_values = '';
    474479                                $original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field->id ) );