fansub_kntl_get_post_type(), 's' => $term, 'posts_per_page' => 10 ); $query = fansub_query($args); $defaults = fansub_kntl_get_option_defaults(); $option_data = fansub_kntl_get_option(); $option_data = wp_parse_args($option_data, $defaults); $single_page = fansub_get_value_by_key($option_data, 'single_page'); while ($query->have_posts()) { $query->the_post(); $thumbnail_url = fansub_get_post_thumbnail_url(); $image_url = bfi_thumb($thumbnail_url, array('width' => 70, 'height' => 90, 'crop' => true)); $thumb_url = bfi_thumb($thumbnail_url, array('width' => 70, 'height' => 50, 'crop' => true)); $permalink = fansub_kntl_build_single_url($single_page, get_the_ID()); ob_start(); ?>
get_the_title(), 'link' => get_permalink(), 'html' => $post_html ); $suggestions[] = $suggestion; } wp_reset_postdata(); if ($query->have_posts()) { $suggestion = array( 'label' => 'View more', 'link' => get_search_link($term) ); $suggestions[] = $suggestion; } echo json_encode($suggestions); exit; } add_action('wp_ajax_fansub_search_autocomplete', 'fansub_search_autocomplete_ajax_callback'); add_action('wp_ajax_nopriv_fansub_search_autocomplete', 'fansub_search_autocomplete_ajax_callback'); function fansub_kntl_video_list_ajax_callback() { $post_id = isset($_POST['post_id']) ? $_POST['post_id'] : 0; $jwplayer = isset($_POST['jwplayer']) ? $_POST['jwplayer'] : false; $result = array( 'have_posts' => false, 'has_data' => false ); $html_data = ''; if (!(bool)$jwplayer) { $video = fansub_query_post_by_meta('animation', $post_id, array('post_type' => 'video', 'posts_per_page' => -1), 'numeric'); $result['have_posts'] = $video->have_posts(); while ($video->have_posts()) { $video->the_post(); $id = get_the_ID(); $fancy_id = 'videoBox' . $id; $jwplayer_video_url = get_post_meta($id, '_jwppp-video-url-1', true); ob_start(); $article = '