Created
January 27, 2015 09:42
-
-
Save slifin/59d8a1f0848b77af3aa8 to your computer and use it in GitHub Desktop.
get chapters for relevant book
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sdesigns_ajax_bookblock_function(){ | |
$download_id = $_POST['id']; | |
$output = ''; | |
if ( $_POST['sameIds'] ) { | |
$args = array( | |
'post_type' => 'book', | |
'posts_per_page' => -1, | |
'order' => 'ASC' | |
); | |
} else { | |
$args = array( | |
'post_type' => 'book', | |
'posts_per_page' => -1, | |
'order' => 'ASC', | |
'meta_key' => 'chapter_belongs_to', | |
'meta_value' => $download_id | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment