PluginProbe
WP Ultimate Post Grid / 2.6.0
WP Ultimate Post Grid v2.6.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / helpers / pagination.php

pagination.php in WP Ultimate Post Grid 2.6.0, at helpers/pagination.php

29 lines 707 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class WPUPG_Pagination {
4
5 public function __construct()
6 {
7 add_action( 'wp_ajax_wpupg_get_page', array( $this, 'ajax_get_page' ) );
8 add_action( 'wp_ajax_nopriv_wpupg_get_page', array( $this, 'ajax_get_page' ) );
9 }
10
11 public function ajax_get_page()
12 {
13 if( check_ajax_referer( 'wpupg_grid', 'security', false ) )
14 {
15 $grid = $_POST['grid'];
16 $page = intval( $_POST['page'] );
17
18 $post = get_page_by_path( $grid, OBJECT, WPUPG_POST_TYPE );
19
20 if( !is_null( $post ) ) {
21 $grid = new WPUPG_Grid($post);
22
23 echo $grid->draw_posts( $page );
24 }
25 }
26
27 die();
28 }
29 }