Plugin Directory

Changeset 1605867


Ignore:
Timestamp:
03/01/2017 11:10:48 AM (9 years ago)
Author:
jamesparkninja
Message:

New Release Update: Better structure for My Requests list

Location:
nexus/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nexus/trunk/inc/nexus_api/lists/request.php

    r1604405 r1605867  
    5858        'posts_per_page' => -1,
    5959        'order' => 'ASC',
    60         'meta_key' => 'nexus_signoff_toggle',
    61         'meta_value' => 1,
    62         'meta_compare' => '==',
     60        'meta_query' => array(
     61            'relation' => 'AND',
     62            array(
     63                'key' => 'nexus_signoff_toggle',
     64                'value' => 1,
     65                'compare' => '==',
     66            ),
     67        ),
    6368    );
    6469
     
    6873
    6974    if ($designerID && $designerID != '') {
    70         $sortBy['meta_key'] = 'nexus_assigned_user';
    71         $sortBy['meta_value'] = $designerID;
    72         $sortBy['meta_compare'] = '==';
     75        $sortByAssigned['meta_query'][] = array('key'=>'nexus_assigned_user','value'=>$designerID,'compare'=>'==');
     76        $sortBySignoff['meta_query'][] = array('key'=>'nexus_assigned_user','value'=>$designerID,'compare'=>'==');
    7377    }
    7478
     
    119123   
    120124<?php
    121     if ($requestType == 'all' || $requestType == 'action' || $requestType == 'search') {
     125    if ($requestType == 'action' || $requestType == 'search') {
    122126       
    123127        $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();
     
    133137    } else {
    134138       
    135         $newQ = new WP_Query($sortByNew); if ( $newQ->have_posts() ) : ?>
    136             <div class="pure-u-5-5">
    137                 <h2 class="subsection">
    138                     <?php echo $newQ->found_posts; ?> New Requests
    139                 </h2>
    140             </div>
    141         <?php while ( $newQ->have_posts() ) : $newQ->the_post();
    142             include(nexus_plugin_inc('nexus_api/panels/request_preview.php'));
    143         endwhile; endif; wp_reset_query();
     139        if (!$designerID) {
     140            $newQ = new WP_Query($sortByNew); if ( $newQ->have_posts() ) : ?>
     141                <div class="pure-u-5-5">
     142                    <h2 class="subsection">
     143                        <?php echo $newQ->found_posts; ?> New Requests
     144                    </h2>
     145                </div>
     146            <?php while ( $newQ->have_posts() ) : $newQ->the_post();
     147                include(nexus_plugin_inc('nexus_api/panels/request_preview.php'));
     148            endwhile; endif; wp_reset_query();
     149        }
    144150       
    145151        $assQ = new WP_Query($sortByAssigned); if ( $assQ->have_posts() ) : $assC = 0; while ( $assQ->have_posts() ) : $assQ->the_post(); if (get_post_meta(get_the_ID(), 'nexus_signoff_toggle',true) != 1) { $assC = $assC + 1; } endwhile; ?>
  • nexus/trunk/nexus.php

    r1604405 r1605867  
    44Plugin URI:  http://nexus.jamespark.ninja
    55Description: The central hub for project management - Community Edition
    6 Version:     0.6
     6Version:     0.7
    77Author:      JamesPark.ninja
    88Author URI:  http://jamespark.ninja/
  • nexus/trunk/readme.txt

    r1604405 r1605867  
    55Requires at least: 4.6
    66Tested up to: 4.7
    7 Stable tag: 0.6
     7Stable tag: 0.7
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4141== Changelog ==
    4242
     43= 0.7 =
     44* Updated "My Requests" list to use a more filtered structure (Assigned / Signoff)
     45
    4346= 0.6 =
    4447* First WordPress release
Note: See TracChangeset for help on using the changeset viewer.