Exemplo n.º 1
0
function s4wp_admin_head()
{
    // include our default css
    if (file_exists(dirname(__FILE__) . '/template/search.css')) {
        wp_enqueue_style('solr-search', plugins_url('/template/search.css', __FILE__));
    }
    wp_enqueue_script('solr-js', plugins_url('/template/script.js', __FILE__), false);
    $solr_js = array('ajax_url' => admin_url('admin-ajax.php'), 'post_types' => s4wp_get_post_types(), 'security' => wp_create_nonce("solr_security"));
    wp_localize_script('solr-js', 'solr', $solr_js);
}
        <th scope="row"><?php 
_e('Load All Posts', 'solr4wp');
?>
</th>
        <td><input type="submit" class="button-primary" name="s4wp_postload['posts']" value="<?php 
_e('Execute', 'solr4wp');
?>
" /></td>
    </tr -->

<!--
  Let's loop through each Post type, and give an option to add them into the
  Solr index.
-->
<?php 
$postTypes = s4wp_get_post_types();
foreach ($postTypes as $postType) {
    ?>
<tr valign="top">
    <th scope="row"><?php 
    _e('Load All ' . esc_html($postType->post_type) . '(s)', 'solr4wp');
    ?>
</th>
    <td><input type="button" class="button-primary s4wp_postload_<?php 
    print esc_attr($postType->post_type);
    ?>
" name="s4wp_postload_<?php 
    print esc_attr($postType->post_type);
    ?>
" value="<?php 
    _e('Execute', 'solr4wp');