wp_ajax_find_posts

The timeline below displays how wordpress function wp_ajax_find_posts has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Handles querying posts for the Find Posts modal via AJAX.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    $search = wp_unslash($_POST['ps']);
    if ('' !== $search) {
        $args['s'] = $search;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' === $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' === $post->post_date) {
            $time = '';
        } else {
            /* translators: Date format in table columns, see https://www.php.net/manual/datetime.format.php */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 6.1

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    $search = wp_unslash($_POST['ps']);
    if ('' !== $search) {
        $args['s'] = $search;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' === $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' === $post->post_date) {
            $time = '';
        } else {
            /* translators: Date format in table columns, see https://www.php.net/manual/datetime.format.php */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 5.6

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' === $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' === $post->post_date) {
            $time = '';
        } else {
            /* translators: Date format in table columns, see https://www.php.net/manual/datetime.format.php */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 5.5

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' === $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' === $post->post_date) {
            $time = '';
        } else {
            /* translators: Date format in table columns, see https://www.php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 5.4

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' == $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: Date format in table columns, see https://www.php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 5.3

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' == $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: Date format in table columns, see https://secure.php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 4.6

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' == $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: date format in table columns, see https://secure.php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 4.1

/**
 * Ajax handler for querying posts for the Find Posts modal.
 *
 * @see window.findPosts
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' == $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: date format in table columns, see http://php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 4.0

/**
 * Ajax handler for finding posts.
 *
 * @since 3.1.0
 */
function wp_ajax_find_posts()
{
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_send_json_error(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' == $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: date format in table columns, see http://php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 3.9

function wp_ajax_find_posts()
{
    global $wpdb;
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $searchand = $search = '';
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_die(__('No items found.'));
    }
    $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    $alt = '';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        $alt = ('alternate' == $alt) ? '' : 'alternate';
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: date format in table columns, see http://php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="' . trim('found-posts ' . $alt) . '"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    wp_send_json_success($html);
}

WordPress Version: 3.7

function wp_ajax_find_posts()
{
    global $wpdb;
    check_ajax_referer('find-posts');
    $post_types = get_post_types(array('public' => true), 'objects');
    unset($post_types['attachment']);
    $s = wp_unslash($_POST['ps']);
    $searchand = $search = '';
    $args = array('post_type' => array_keys($post_types), 'post_status' => 'any', 'posts_per_page' => 50);
    if ('' !== $s) {
        $args['s'] = $s;
    }
    $posts = get_posts($args);
    if (!$posts) {
        wp_die(__('No items found.'));
    }
    $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>' . __('Title') . '</th><th class="no-break">' . __('Type') . '</th><th class="no-break">' . __('Date') . '</th><th class="no-break">' . __('Status') . '</th></tr></thead><tbody>';
    foreach ($posts as $post) {
        $title = trim($post->post_title) ? $post->post_title : __('(no title)');
        switch ($post->post_status) {
            case 'publish':
            case 'private':
                $stat = __('Published');
                break;
            case 'future':
                $stat = __('Scheduled');
                break;
            case 'pending':
                $stat = __('Pending Review');
                break;
            case 'draft':
                $stat = __('Draft');
                break;
        }
        if ('0000-00-00 00:00:00' == $post->post_date) {
            $time = '';
        } else {
            /* translators: date format in table columns, see http://php.net/date */
            $time = mysql2date(__('Y/m/d'), $post->post_date);
        }
        $html .= '<tr class="found-posts"><td class="found-radio"><input type="radio" id="found-' . $post->ID . '" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
        $html .= '<td><label for="found-' . $post->ID . '">' . esc_html($title) . '</label></td><td class="no-break">' . esc_html($post_types[$post->post_type]->labels->singular_name) . '</td><td class="no-break">' . esc_html($time) . '</td><td class="no-break">' . esc_html($stat) . ' </td></tr>' . "\n\n";
    }
    $html .= '</tbody></table>';
    $x = new WP_Ajax_Response();
    $x->add(array('data' => $html));
    $x->send();
}