bp_notifications_sort_order_form()
Output the form for changing the sort order of notifications.
Description
Source
File: bp-notifications/bp-notifications-template.php
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 | function bp_notifications_sort_order_form() { // Setup local variables. $orders = array ( 'DESC' , 'ASC' ); $selected = 'DESC' ; // Check for a custom sort_order. if ( ! empty ( $_REQUEST [ 'sort_order' ] ) ) { if ( in_array( $_REQUEST [ 'sort_order' ], $orders ) ) { $selected = $_REQUEST [ 'sort_order' ]; } } ?> <form action= "" method= "get" id= "notifications-sort-order" > <label for = "notifications-sort-order-list" ><?php esc_html_e( 'Order By:' , 'buddyboss' ); ?></label> <select id= "notifications-sort-order-list" name= "sort_order" onchange= "this.form.submit();" > <option value= "DESC" <?php selected( $selected , 'DESC' ); ?>><?php _e( 'Newest First' , 'buddyboss' ); ?></option> <option value= "ASC" <?php selected( $selected , 'ASC' ); ?>><?php _e( 'Oldest First' , 'buddyboss' ); ?></option> </select> <noscript> <input id= "submit" type= "submit" name= "form-submit" class = "submit" value= "<?php esc_attr_e( 'Go', 'buddyboss' ); ?>" /> </noscript> </form> <?php } |
Changelog
Version | Description |
---|---|
BuddyPress 1.9.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.