[buddypress-trac] [BuddyPress Trac] #6272: Add new hook admin_new_field_html_additional_options to allows plugin authors to add options to multi fields without the need to replicate the code

buddypress-trac noreply at wordpress.org
Mon Mar 2 10:47:27 UTC 2015


#6272: Add new hook admin_new_field_html_additional_options to allows plugin
authors to add options to multi fields without the need to replicate the
code
-------------------------+-----------------------------
 Reporter:  svenl77      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  API          |    Version:  2.2.1
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 I would like to add one new hook.

 I need to add additional options to the multi select field. In my case
 minimumSelectionSize and maximumSelectionSize options.

 That was not easy done because I need to replicate the
 admin_new_field_html and add my options under the sort_order select.

 {{{
 <p>
     <label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php
 esc_html_e( 'Sort Order:', 'buddypress' ); ?></label>
     <select name="sort_order_<?php echo esc_attr( $type ); ?>"
 id="sort_order_<?php echo esc_attr( $type ); ?>" >
         <option value="custom" <?php selected( 'custom',
 $current_field->order_by ); ?>><?php esc_html_e( 'Custom',
 'buddypress' ); ?></option>
         <option value="asc"    <?php selected( 'asc',
 $current_field->order_by ); ?>><?php esc_html_e( 'Ascending',
 'buddypress' ); ?></option>
         <option value="desc"   <?php selected( 'desc',
 $current_field->order_by ); ?>><?php esc_html_e( 'Descending',
 'buddypress' ); ?></option>
     </select>
 </p>
 }}}


 I can already save new options with "xprofile_field_after_save", but I can
 not add additional options to the multi field.

 This new hook solves exactly this issue. I hope you can add it to the next
 version.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6272>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list