First of all, please don't mark the question as duplicate as I didn't ask how to send arguments with ajax request.
I want to receive some extra arguments on ajax success. My callback function will return some html data. But I want to get some other arguments with that data.
maybe something like:
success: function( data, arg_1, arg_2 ) {
if( arg_1 ) {
$('selector').append( data );
} else if( arg_2 ) {
$('other_selector').append( data );
}
}
But I don't know how to pass arguments like this. Any idea?
My current callback function makes a query with custom post and uses get_template_part()
function to load them.