Activity_Helper::_ajax_more_activities()
Description #
Callback for loading more activities.
Source #
File: includes/class/class-activity-helper.php
public static function _ajax_more_activities() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore // Check ajax referer. if ( ! check_ajax_referer( 'load_activities', '__nonce', false ) ) { ap_ajax_json( 'something_wrong' ); } $activities = new \AnsPress\Activity( array( 'paged' => max( 1, ap_isset_post_value( 'paged', 1 ) ), ) ); ob_start(); include ap_get_theme_location( 'activities/activities.php' ); $html = ob_get_clean(); ap_ajax_json( array( 'success' => true, 'html' => $html, 'cb' => 'loadedMoreActivities', ) ); }
Expand full source code Collapse full source code View on GitHub: includes/class/class-activity-helper.php:127
Add your comment