- Timestamp:
- 03/19/2018 05:20:23 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/blogs/ajax.php
r11899 r11903 9 9 defined( 'ABSPATH' ) || exit; 10 10 11 /** 12 * Registers friends AJAX actions. 13 * 14 * @todo this funciton CANNOT be run when the file is included (like it is now). Move to a function and hook to something. 15 */ 16 bp_nouveau_register_ajax_actions( 17 array( 11 add_action( 'admin_init', function() { 12 $ajax_actions = array( 18 13 array( 19 14 'blogs_filter' => array( … … 22 17 ), 23 18 ), 24 ) 25 ); 19 ); 20 21 foreach ( $ajax_actions as $ajax_action ) { 22 $action = key( $ajax_action ); 23 24 add_action( 'wp_ajax_' . $action, $ajax_action[ $action ]['function'] ); 25 26 if ( ! empty( $ajax_action[ $action ]['nopriv'] ) ) { 27 add_action( 'wp_ajax_nopriv_' . $action, $ajax_action[ $action ]['function'] ); 28 } 29 } 30 }, 12 );
Note: See TracChangeset
for help on using the changeset viewer.