Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (34 sloc) 1.02 KB
<?php
// Setup your AJAX functionality here
/*
add_action( 'wp_enqueue_scripts', 'localize_ajax' );
function localize_ajax() {
// Localize scripts for connecting to ajax
wp_localize_script( 'twentysixteen-script', 'my_ajax_script', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
)
);
}
*/
/*
Registering all our ajax functions. All ajax functionality
is managed below. wp_ajax_nopriv is for users that are not logged in.
*/
//add_action("wp_ajax_get_special_items", "get_special_items");
//add_action("wp_ajax_nopriv_get_special_items", "get_special_items");
/*
function get_special_items() {
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$limit = isset($_GET['limit']) ? $_GET['limit'] : 5;
$context = Timber::get_context();
// GET 'SPECIAL' POST TYPE
$args = array(
'post_type' => 'special',
'posts_per_page' => $limit,
'offset' => $offset,
);
// Output using Timber
$context['posts'] = Timber::get_posts($args);
Timber::render('partials/post.twig', $context);
}
*/