Skip to:
Content

BuddyPress.org

Changeset 10328


Ignore:
Timestamp:
11/10/2015 10:54:14 PM (11 years ago)
Author:
boonebgorges
Message:

Specify richtext xprofile field editor height on a per-context basis.

When displaying the edit format preview on Dashboard > Users > Profile Fields,
the default 'textarea_rows' value of 20 was far too high. This changeset
changes it to 1, and specifies a value of 10 for other instances of the editor.

To accommodate these different values, a $context parameter is added to the
bp_xprofile_field_type_textarea_editor_args filter, with possible values
'edit' and 'admin'.

Props imath.
Fixes #6722.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php

    r10254 r10328  
    9797                         *     @type bool $media_buttons Whether to show media buttons. Default false.
    9898                         *     @type bool $quicktags     Whether to show the quicktags buttons. Default true.
     99                         *     @type int  $textarea_rows Number of rows to display in the editor. Defaults to 1 in the
     100                         *                               'admin' context, and 10 in the 'edit' context.
    99101                         * }
     102                         * @param string $context The display context. 'edit' when the markup is intended for the
     103                         *                        profile edit screen, 'admin' when intended for the Profile Fields
     104                         *                        Dashboard panel.
    100105                         */
    101106                        $editor_args = apply_filters( 'bp_xprofile_field_type_textarea_editor_args', array(
     
    103108                                'media_buttons' => false,
    104109                                'quicktags'     => true,
    105                         ) );
     110                                'textarea_rows' => 10,
     111                        ), 'edit' );
    106112
    107113                        wp_editor(
     
    142148                                'media_buttons' => false,
    143149                                'quicktags'     => true,
    144                         ) );
     150                                'textarea_rows' => 1,
     151                        ), 'admin' );
    145152
    146153                        wp_editor(
Note: See TracChangeset for help on using the changeset viewer.