I am passing a json in my ajax request but it is just returning 10 every time, why??
whay my array in not getting passed??
Here is my code:
jQuery(document).ready(function($){
$('#list-3 .ajaxcall').click(function(){
$.ajax({
type : "GET",
url : ajaxurl,
dataType: 'json',
contentType: "application/json; charset=utf-8",
data : {
gpl_args : JSON.stringify({"cat":"26","posts_per_page":"4","paged":1}),
gpl_layout : {"show_thumb":"1","columns":"4","thumb_height":"85","thumb_width":"85","title_link":"1","content_excerpt":"50","posts_per_page":"4"}
},
success : function(response) {
// The server has finished executing PHP and has returned something,
// so display it!
$("#list-3").append(response);
}
});
});
});
and:
$args = isset($_REQUEST['gpl_args']);
//$args = json_encode(isset($_REQUEST['gpl_args']));
print_r($args)
Update:
my data inside ajax:
data : { gpl_args : JSON.stringify(<?php echo json_encode($args); ?>),
JSON.stringify(gpl_layout : <?php echo json_encode($layout); ?>)},