bp_die_legacy_ajax_callbacks()


Description Description


Source Source

File: bp-core/deprecated/1.6.php

	function bp_die_legacy_ajax_callbacks() {

		// This is a list of the BP wp_ajax_ hook suffixes whose associated functions did
		// not die properly before BP 1.6
		$actions = array(
			// Directory template loaders
			'members_filter',
			'groups_filter',
			'blogs_filter',
			'forums_filter',
			'messages_filter',

			// Activity
			'activity_widget_filter',
			'activity_get_older_updates',
			'post_update',
			'new_activity_comment',
			'delete_activity',
			'delete_activity_comment',
			'spam_activity',
			'spam_activity_comment',
			'activity_mark_fav',
			'activity_mark_unfav',

			// Groups
			'groups_invite_user',
			'joinleave_group',

			// Members
			'addremove_friend',
			'accept_friendship',
			'reject_friendship',

			// Messages
			'messages_close_notice',
			'messages_send_reply',
			'messages_markunread',
			'messages_markread',
			'messages_delete',
			'messages_autocomplete_results'
		);

		// For each of the problematic hooks, exit at the very end of execution
		foreach( $actions as $action ) {
			add_action( 'wp_ajax_' . $action, function() {
				exit;
			}, 9999 );

			add_action( 'wp_ajax_nopriv_' . $action, function() {
				exit;
			}, 9999 );
		}
	}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.