get_json_params(); $postId = ! empty( $body['id'] ) ? intval( $body['id'] ) : null; $context = ! empty( $body['context'] ) ? sanitize_text_field( $body['context'] ) : 'post'; // We just need to schedule a post or term ping. if ( 'post' === $context ) { $post = aioseo()->helpers->getPost( $postId ); aioseoIndexNow()->ping->schedulePost( $postId, $post ); return $response; } aioseoIndexNow()->ping->scheduleTerm( $postId ); return $response; } }