Example #1
0
<script type="text/javascript">
    var meAnjanWqgPostMetaList = <?php 
echo json_encode($metaKeys);
?>
;
</script>

<table class="form-table">

    <tr>
        <td>
            <label>
                <strong>Sort By (#orderby)</strong>Order by field<br/>
                <?php 
$orderByKeys = meAnjanWqg_Posts::getPostOrderByFields();
$selectedOrderBykeys = meAnjanWqg_Utils::arrayValueAsString($wqgData, 'sorting/orderby', 'date', 'trim');
?>

                <select id="<?php 
echo $idPrefix;
?>
sorting-orderby" name="sorting[orderby]" class="chosen" data-placeholder="Select the field">
                    <?php 
foreach ($orderByKeys as $key) {
    ?>
                        <option value="<?php 
    echo $key;
    ?>
"
                                <?php 
Example #2
0
<?php

$metaComparisonTypes = array('=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'NOT EXISTS', 'REGEXP', 'NOT REGEXP', 'RLIKE');
?>

<table class="form-table">
    <tr>
        <td>
            <label>
                <strong>Meta Key (#meta_key)</strong>Meta key name<br/>

                <select size="1" name="meta[key]" data-placeholder=" ">
                    <option></option>
                    <?php 
foreach (meAnjanWqg_Posts::getAllPostMetaKeys() as $metaKey) {
    ?>
                    <option value="<?php 
    echo $metaKey;
    ?>
" <?php 
    if ($metaKey == meAnjanWqg_Utils::arrayValue($wqgData, 'meta/key')) {
        ?>
selected<?php 
    }
    ?>
><?php 
    echo $metaKey;
    ?>
</option>
                    <?php 
}
Example #3
0
                <?php 
echo meAnjanWqg_Posts::postsDropdown(array('post_type' => 'post', 'nopaging' => TRUE, 'empty_value' => array('label' => '~ Select ~', 'value' => ''), 'label_field' => 'post_name', 'value_field' => 'post_name', 'attributes' => array('name' => 'post[post_slug]', 'id' => 'post_slug', 'class' => 'chosen'), 'selected' => meAnjanWqg_Utils::arrayValue($wqgData, 'post/post_slug')));
?>
            </label>
        </td>
    </tr> <!-- post_slug -->

    <tr>
        <td>
            <label>
                <strong>Page ID (#p)</strong>Get entries by selected post id<br/>

                <?php 
echo meAnjanWqg_Posts::postsDropdown(array('post_type' => 'page', 'nopaging' => TRUE, 'empty_value' => array('label' => '~ Select ~', 'value' => ''), 'label_field' => 'post_title', 'value_field' => 'ID', 'attributes' => array('name' => 'post[page_id]', 'id' => 'page_id', 'class' => 'chosen'), 'selected' => meAnjanWqg_Utils::arrayValue($wqgData, 'post/page_id')));
?>
            </label>
        </td>
    </tr> <!-- page_id -->
    <tr>
        <td>
            <label>
                <strong>Post Slug (#name)</strong>Get entries by selected post slug<br/>

                <?php 
echo meAnjanWqg_Posts::postsDropdown(array('post_type' => 'page', 'nopaging' => TRUE, 'empty_value' => array('label' => '~ Select ~', 'value' => ''), 'label_field' => 'post_name', 'value_field' => 'post_name', 'attributes' => array('name' => 'post[page_slug]', 'id' => 'page_slug', 'class' => 'chosen'), 'selected' => meAnjanWqg_Utils::arrayValue($wqgData, 'post/page_slug')));
?>
            </label>
        </td>
    </tr> <!-- page_slug -->
</table>
 /**
  * Gets list of post entries for AJAX
  */
 public function __action_PostList()
 {
     $posts = array();
     meAnjanWqg_Posts::getPostsMinimal($posts, $_GET);
     echo json_encode($posts);
     exit;
 }
Example #5
0
echo meAnjanWqg_Posts::postsDropdown(array('post_type' => $selectedPostTypes, 'nopaging' => TRUE, 'empty_value' => array('label' => '', 'value' => ''), 'label_field' => 'post_name', 'value_field' => 'post_name', 'attributes' => array('name' => 'post[post_slug]', 'id' => $idPrefix . 'post-slug', 'class' => 'chosen', 'data-placeholder' => ' '), 'selected' => meAnjanWqg_Utils::arrayValue($wqgData, 'post/post_slug')));
?>
            </label>
        </td>
    </tr> <!-- post_slug -->

    <tr>
        <td>
            <label>
                <strong>Parent Post (#post_parent)</strong>Get child posts<br/>

                <?php 
echo meAnjanWqg_Posts::postsDropdown(array('post_type' => $selectedPostTypes, 'nopaging' => TRUE, 'label_field' => 'post_title', 'label_field_extra' => 'ID', 'value_field' => 'ID', 'attributes' => array('name' => 'post[post_parent][]', 'id' => $idPrefix . 'post-parent', 'class' => 'chosen', 'data-placeholder' => 'Select one or more posts', 'multiple' => 'multiple'), 'selected' => meAnjanWqg_Utils::arrayValue($wqgData, 'post/post_parent')));
?>
            </label>
        </td>
    </tr> <!-- post_parent -->

    <tr>
        <td>
            <label>
                <strong>Exclude Parent Posts (#post_parent__not_in)</strong>Exclude posts with these parent posts<br/>

                <?php 
echo meAnjanWqg_Posts::postsDropdown(array('post_type' => $selectedPostTypes, 'nopaging' => TRUE, 'label_field' => 'post_title', 'label_field_extra' => 'ID', 'value_field' => 'ID', 'attributes' => array('name' => 'post[post_parent_not_in][]', 'id' => $idPrefix . 'post-parent-not-in', 'class' => 'chosen', 'data-placeholder' => 'Select one or more posts', 'multiple' => 'multiple'), 'selected' => meAnjanWqg_Utils::arrayValue($wqgData, 'post/post_parent_not_in')));
?>
            </label>
        </td>
    </tr> <!-- post_parent__not_in -->

</table>