Skip to:
Content

BuddyPress.org

Ticket #5184: 0004-Return-the-placeholder-text-for-a-field-if-it-exists.patch

File 0004-Return-the-placeholder-text-for-a-field-if-it-exists.patch, 956 bytes (added by haykayltduk, 10 years ago)

if the field has placeholder, return that; or default to the existing text

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

    From e01aab85836412b667b18d719005d6721dd8ace6 Mon Sep 17 00:00:00 2001
    From: Anand Kumria <akumria@acm.org>
    Date: Sun, 24 Nov 2013 15:46:08 +0000
    Subject: [PATCH 4/4] Return the placeholder text for a field if it exists.
    
    ---
     bp-xprofile/bp-xprofile-template.php |    6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/bp-xprofile/bp-xprofile-template.php b/bp-xprofile/bp-xprofile-template.php
    index b16f608..ab2af1a 100644
    a b function bp_the_profile_field_options( $args = '' ) { 
    422422}
    423423
    424424function bp_get_placeholder_text_for_field( $field ) {
    425     return /* translators: no option picked in select box */ __( '----', 'buddypress' ) ;
     425    if ($field->placeholder) {
     426                return $field->placeholder;
     427    } else {
     428                return /* translators: no option picked in select box */ __( '----', 'buddypress' ) ;
     429    }
    426430}
    427431
    428432        /**