Plugin Directory

Changeset 2480680


Ignore:
Timestamp:
02/24/2021 01:08:40 PM (5 years ago)
Author:
daggerhart
Message:

Update to version 1.5.49 from GitHub

Location:
query-wrangler
Files:
2 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • query-wrangler/tags/1.5.49/README.txt

    r2302781 r2480680  
    44Tags: query, pages, widget, admin, widgets, administration, manage, views, loop
    55Requires at least: 4
    6 Tested up to: 5.4.1
     6Tested up to: 5.6.2
    77Stable tag: trunk
    88
     
    7575== Changelog ==
    7676
     77= 1.5.49 =
     78
     79* Feature: Setting to hide header or footer when no results are found.
     80
    7781= 1.5.48 =
    7882
     
    271275* Fix: Unserialize bug - http://wordpress.org/support/topic/bug-that-wipes-all-settings-of-query-after-excluding-fields-from-display?replies=2
    272276* Fix: 3.7 problem - according to - http://wordpress.org/support/topic/update-has-broken-site#post-4868397
    273 * Fix: Row style settings form bug 
     277* Fix: Row style settings form bug
    274278* More complete default query according to WP_Query defaults
    275279* Feature: PHP WP_Query in preview
    276280
    277281= 1.5rc12 =
    278  
     282
    279283 * New page routing with hook parse_request
    280284
    281285= 1.5rc11 =
    282  
     286
    283287 * Chasing WP 3.7 related bugs
    284288
     
    286290
    287291 * UI fixes and improvements.
    288  
     292
    289293= 1.5rc9 =
    290294
     
    294298
    295299 * Fix: Fixing sortable jquery ui issue.  QW UI working w/ WP 3.5
    296  
     300
    297301= 1.5rc7 =
    298302
    299303 * Fix: No longer relying on external jquery sources, working to fix views ui
    300  
     304
    301305= 1.5rc6 =
    302306
    303307 * Fix: WP update broke jquery and jquery ui. now relying on external sources
    304  
     308
    305309= 1.5rc5 =
    306310
  • query-wrangler/tags/1.5.49/admin/css/query-wrangler.css

    r1254091 r2480680  
    219219}
    220220
    221 .ui-dialog .ui-dialog-titlebar-close span {
     221.qw-dialog .ui-dialog-titlebar-close span {
    222222    margin: -8px 0 0 -8px;
     223}
     224
     225.qw-dialog .ui-dialog-buttonset .ui-widget {
     226    display: inline-block;
     227    text-decoration: none;
     228    font-size: 13px;
     229    line-height: 1.5;
     230    min-height: 30px;
     231    margin: 0 0 0 6px;
     232    padding: 0 6px;
     233    cursor: pointer;
     234    border-width: 1px;
     235    border-style: solid;
     236    -webkit-appearance: none;
     237    border-radius: 3px;
     238    white-space: nowrap;
     239    box-sizing: border-box;
     240    background: #f1f1f1;
     241    border-color: #016087;
     242    color: #016087;
     243}
     244.qw-dialog .ui-dialog-buttonset .ui-widget:first-of-type {
     245    background: #0071a1;
     246    border-color: #0071a1;
     247    color: #fff;
    223248}
    224249
  • query-wrangler/tags/1.5.49/admin/editors/views/views.js

    r1254091 r2480680  
    214214            title: dialog_title,
    215215            resizable: false,
     216            closeText: "",
     217            classes: {
     218              "ui-dialog": "qw-dialog",
     219            },
    216220
    217221            open: function () {
  • query-wrangler/tags/1.5.49/admin/templates/preview-json.php

    r1254091 r2480680  
    88$options = qw_generate_query_options( $query_id, $options, TRUE );
    99
    10 do_action_ref_array( 'qw_pre_preview', array( &$options ) );
    11 
    1210// get formatted query arguments
    1311$args = qw_generate_query_args( $options );
     12
     13// pre_query hook
     14$args = apply_filters( 'qw_pre_query', $args, $options );
     15
    1416// set the new query
    1517$wp_query = new WP_Query( $args );
     18
     19// pre_render hook
     20$options = apply_filters( 'qw_pre_render', $options, $wp_query );
    1621
    1722// get the themed content
  • query-wrangler/tags/1.5.49/includes/basics/footer.php

    r1254091 r2480680  
    2121function qw_basic_footer_form( $basic, $display ) {
    2222    $footer = isset( $display['footer'] ) ? $display['footer'] : "";
     23    $settings = !empty( $display['footer_settings'] ) ? $display['footer_settings'] : [];
    2324    ?>
    2425    <p class="description"><?php print $basic['description']; ?></p>
    2526    <textarea name="<?php print $basic['form_prefix']; ?>[footer]"
    2627              class="qw-field-textarea qw-js-title"><?php print qw_textarea( $footer ); ?></textarea>
     28    <p>
     29        <label for="hide-footer-empty">
     30            <input
     31                type="checkbox"
     32                id="hide-footer-empty"
     33                name="<?php print $basic['form_prefix'] ?>[footer_settings][hide_if_empty]"
     34                value="1"
     35                <?php checked( !empty($settings['hide_if_empty'] ) ) ?>
     36            >
     37            <?php _e('Hide footer when query has no results') ?>
     38        </label>
     39    </p>
    2740<?php
    2841}
     42
     43/*
     44 * Hide the footer if the query result is empty.
     45 */
     46add_filter( 'qw_pre_render', function( $options, $wp_query ) {
     47    if ( !empty( $options['display']['footer_settings']['hide_if_empty'] ) && !count($wp_query->posts) ) {
     48        $options['meta']['footer'] = '';
     49    }
     50
     51    return $options;
     52}, 0, 2 );
  • query-wrangler/tags/1.5.49/includes/basics/header.php

    r1254091 r2480680  
    2020function qw_basic_header_form( $basic, $display ) {
    2121    $header = isset( $display['header'] ) ? $display['header'] : "";
     22    $settings = !empty( $display['header_settings'] ) ? $display['header_settings'] : [];
    2223    ?>
    2324    <p class="description"><?php print $basic['description']; ?></p>
    2425    <textarea name="<?php print $basic['form_prefix']; ?>[header]"
    2526              class="qw-field-textarea qw-js-title"><?php print qw_textarea( $header ); ?></textarea>
     27    <p>
     28        <label for="hide-header-empty">
     29            <input
     30                type="checkbox"
     31                id="hide-header-empty"
     32                name="<?php print $basic['form_prefix'] ?>[header_settings][hide_if_empty]"
     33                value="1"
     34                <?php checked( !empty($settings['hide_if_empty'] ) ) ?>
     35            >
     36            <?php _e('Hide header when query has no results') ?>
     37        </label>
     38    </p>
    2639<?php
    2740}
     41
     42/*
     43 * Hide the header if the query result is empty.
     44 */
     45add_filter( 'qw_pre_render', function( $options, $wp_query ) {
     46    if ( !empty( $options['display']['header_settings']['hide_if_empty'] ) && !count($wp_query->posts) ) {
     47        $options['meta']['header'] = '';
     48    }
     49
     50    return $options;
     51}, 0, 2 );
  • query-wrangler/tags/1.5.49/includes/class-qw-query.php

    r1329785 r2480680  
    145145    function theme_query() {
    146146        // pre_render hook
    147         $this->options = apply_filters( 'qw_pre_render', $this->options, $this->args );
     147        $this->options = apply_filters( 'qw_pre_render', $this->options, $this->wp_query );
    148148
    149149        // get the themed content
  • query-wrangler/tags/1.5.49/includes/overrides/categories.php

    r1329785 r2480680  
    108108function qw_override_categories_get_query( $wp_query ) {
    109109    if ( $wp_query->is_category() && $wp_query->is_archive() ) {
    110         $term     = $wp_query->get_queried_object();
    111         $query_id = qw_get_query_by_override_term( $term->term_id );
     110        $term = $wp_query->get_queried_object();
     111        if ($term instanceof \WP_Term) {
     112            $query_id = qw_get_query_by_override_term($term->term_id);
    112113
    113         if ( $query_id && $qw_query = qw_get_query( $query_id ) ) {
     114            if ($query_id && $qw_query = qw_get_query($query_id)) {
    114115
    115             // add the appropriate filter to the query
    116             $qw_query->add_handler_item( 'filter',
    117                 'categories',
    118                 array(
    119                     'cat_operator' => 'cat',
    120                     'cats'         => array( $term->term_id => $term->name ),
    121                 ) )
    122                 // override the post title
    123                      ->override_options( array(
    124                     'display' => array(
    125                         'title' => single_term_title( '', FALSE ),
    126                     )
    127                 ) );
     116                // add the appropriate filter to the query
     117                $qw_query->add_handler_item('filter',
     118                    'categories',
     119                    array(
     120                        'cat_operator' => 'cat',
     121                        'cats'         => array($term->term_id => $term->name),
     122                    ))
     123                    // override the post title
     124                    ->override_options(array(
     125                        'display' => array(
     126                            'title' => single_term_title('', false),
     127                        )
     128                    ));
    128129
    129             return $qw_query;
    130         }
    131     }
     130                return $qw_query;
     131            }
     132        }
     133    }
    132134
    133135    return FALSE;
  • query-wrangler/tags/1.5.49/includes/query.php

    r2302777 r2480680  
    2626
    2727    // pre_render hook
    28     $options = apply_filters( 'qw_pre_render', $options );
     28    $options = apply_filters( 'qw_pre_render', $options, $qw_query );
    2929
    3030    // get the themed content
  • query-wrangler/tags/1.5.49/query-wrangler.php

    r2302781 r2480680  
    1010Author:            Jonathan Daggerhart
    1111Author URI:        http://daggerhart.com
    12 Version:           1.5.48
     12Version:           1.5.49
    1313
    1414******************************************************************
     
    3131
    3232// some useful definitions
    33 define( 'QW_VERSION', 1.548 );
     33define( 'QW_VERSION', 1.549 );
    3434define( 'QW_PLUGIN_DIR', dirname( __FILE__ ) );
    3535define( 'QW_PLUGIN_URL', plugins_url( '', __FILE__ ) );
  • query-wrangler/trunk/README.txt

    r2302781 r2480680  
    44Tags: query, pages, widget, admin, widgets, administration, manage, views, loop
    55Requires at least: 4
    6 Tested up to: 5.4.1
     6Tested up to: 5.6.2
    77Stable tag: trunk
    88
     
    7575== Changelog ==
    7676
     77= 1.5.49 =
     78
     79* Feature: Setting to hide header or footer when no results are found.
     80
    7781= 1.5.48 =
    7882
     
    271275* Fix: Unserialize bug - http://wordpress.org/support/topic/bug-that-wipes-all-settings-of-query-after-excluding-fields-from-display?replies=2
    272276* Fix: 3.7 problem - according to - http://wordpress.org/support/topic/update-has-broken-site#post-4868397
    273 * Fix: Row style settings form bug 
     277* Fix: Row style settings form bug
    274278* More complete default query according to WP_Query defaults
    275279* Feature: PHP WP_Query in preview
    276280
    277281= 1.5rc12 =
    278  
     282
    279283 * New page routing with hook parse_request
    280284
    281285= 1.5rc11 =
    282  
     286
    283287 * Chasing WP 3.7 related bugs
    284288
     
    286290
    287291 * UI fixes and improvements.
    288  
     292
    289293= 1.5rc9 =
    290294
     
    294298
    295299 * Fix: Fixing sortable jquery ui issue.  QW UI working w/ WP 3.5
    296  
     300
    297301= 1.5rc7 =
    298302
    299303 * Fix: No longer relying on external jquery sources, working to fix views ui
    300  
     304
    301305= 1.5rc6 =
    302306
    303307 * Fix: WP update broke jquery and jquery ui. now relying on external sources
    304  
     308
    305309= 1.5rc5 =
    306310
  • query-wrangler/trunk/admin/css/query-wrangler.css

    r1254091 r2480680  
    219219}
    220220
    221 .ui-dialog .ui-dialog-titlebar-close span {
     221.qw-dialog .ui-dialog-titlebar-close span {
    222222    margin: -8px 0 0 -8px;
     223}
     224
     225.qw-dialog .ui-dialog-buttonset .ui-widget {
     226    display: inline-block;
     227    text-decoration: none;
     228    font-size: 13px;
     229    line-height: 1.5;
     230    min-height: 30px;
     231    margin: 0 0 0 6px;
     232    padding: 0 6px;
     233    cursor: pointer;
     234    border-width: 1px;
     235    border-style: solid;
     236    -webkit-appearance: none;
     237    border-radius: 3px;
     238    white-space: nowrap;
     239    box-sizing: border-box;
     240    background: #f1f1f1;
     241    border-color: #016087;
     242    color: #016087;
     243}
     244.qw-dialog .ui-dialog-buttonset .ui-widget:first-of-type {
     245    background: #0071a1;
     246    border-color: #0071a1;
     247    color: #fff;
    223248}
    224249
  • query-wrangler/trunk/admin/editors/views/views.js

    r1254091 r2480680  
    214214            title: dialog_title,
    215215            resizable: false,
     216            closeText: "",
     217            classes: {
     218              "ui-dialog": "qw-dialog",
     219            },
    216220
    217221            open: function () {
  • query-wrangler/trunk/admin/templates/preview-json.php

    r1254091 r2480680  
    88$options = qw_generate_query_options( $query_id, $options, TRUE );
    99
    10 do_action_ref_array( 'qw_pre_preview', array( &$options ) );
    11 
    1210// get formatted query arguments
    1311$args = qw_generate_query_args( $options );
     12
     13// pre_query hook
     14$args = apply_filters( 'qw_pre_query', $args, $options );
     15
    1416// set the new query
    1517$wp_query = new WP_Query( $args );
     18
     19// pre_render hook
     20$options = apply_filters( 'qw_pre_render', $options, $wp_query );
    1621
    1722// get the themed content
  • query-wrangler/trunk/includes/basics/footer.php

    r1254091 r2480680  
    2121function qw_basic_footer_form( $basic, $display ) {
    2222    $footer = isset( $display['footer'] ) ? $display['footer'] : "";
     23    $settings = !empty( $display['footer_settings'] ) ? $display['footer_settings'] : [];
    2324    ?>
    2425    <p class="description"><?php print $basic['description']; ?></p>
    2526    <textarea name="<?php print $basic['form_prefix']; ?>[footer]"
    2627              class="qw-field-textarea qw-js-title"><?php print qw_textarea( $footer ); ?></textarea>
     28    <p>
     29        <label for="hide-footer-empty">
     30            <input
     31                type="checkbox"
     32                id="hide-footer-empty"
     33                name="<?php print $basic['form_prefix'] ?>[footer_settings][hide_if_empty]"
     34                value="1"
     35                <?php checked( !empty($settings['hide_if_empty'] ) ) ?>
     36            >
     37            <?php _e('Hide footer when query has no results') ?>
     38        </label>
     39    </p>
    2740<?php
    2841}
     42
     43/*
     44 * Hide the footer if the query result is empty.
     45 */
     46add_filter( 'qw_pre_render', function( $options, $wp_query ) {
     47    if ( !empty( $options['display']['footer_settings']['hide_if_empty'] ) && !count($wp_query->posts) ) {
     48        $options['meta']['footer'] = '';
     49    }
     50
     51    return $options;
     52}, 0, 2 );
  • query-wrangler/trunk/includes/basics/header.php

    r1254091 r2480680  
    2020function qw_basic_header_form( $basic, $display ) {
    2121    $header = isset( $display['header'] ) ? $display['header'] : "";
     22    $settings = !empty( $display['header_settings'] ) ? $display['header_settings'] : [];
    2223    ?>
    2324    <p class="description"><?php print $basic['description']; ?></p>
    2425    <textarea name="<?php print $basic['form_prefix']; ?>[header]"
    2526              class="qw-field-textarea qw-js-title"><?php print qw_textarea( $header ); ?></textarea>
     27    <p>
     28        <label for="hide-header-empty">
     29            <input
     30                type="checkbox"
     31                id="hide-header-empty"
     32                name="<?php print $basic['form_prefix'] ?>[header_settings][hide_if_empty]"
     33                value="1"
     34                <?php checked( !empty($settings['hide_if_empty'] ) ) ?>
     35            >
     36            <?php _e('Hide header when query has no results') ?>
     37        </label>
     38    </p>
    2639<?php
    2740}
     41
     42/*
     43 * Hide the header if the query result is empty.
     44 */
     45add_filter( 'qw_pre_render', function( $options, $wp_query ) {
     46    if ( !empty( $options['display']['header_settings']['hide_if_empty'] ) && !count($wp_query->posts) ) {
     47        $options['meta']['header'] = '';
     48    }
     49
     50    return $options;
     51}, 0, 2 );
  • query-wrangler/trunk/includes/class-qw-query.php

    r1329785 r2480680  
    145145    function theme_query() {
    146146        // pre_render hook
    147         $this->options = apply_filters( 'qw_pre_render', $this->options, $this->args );
     147        $this->options = apply_filters( 'qw_pre_render', $this->options, $this->wp_query );
    148148
    149149        // get the themed content
  • query-wrangler/trunk/includes/overrides/categories.php

    r1329785 r2480680  
    108108function qw_override_categories_get_query( $wp_query ) {
    109109    if ( $wp_query->is_category() && $wp_query->is_archive() ) {
    110         $term     = $wp_query->get_queried_object();
    111         $query_id = qw_get_query_by_override_term( $term->term_id );
     110        $term = $wp_query->get_queried_object();
     111        if ($term instanceof \WP_Term) {
     112            $query_id = qw_get_query_by_override_term($term->term_id);
    112113
    113         if ( $query_id && $qw_query = qw_get_query( $query_id ) ) {
     114            if ($query_id && $qw_query = qw_get_query($query_id)) {
    114115
    115             // add the appropriate filter to the query
    116             $qw_query->add_handler_item( 'filter',
    117                 'categories',
    118                 array(
    119                     'cat_operator' => 'cat',
    120                     'cats'         => array( $term->term_id => $term->name ),
    121                 ) )
    122                 // override the post title
    123                      ->override_options( array(
    124                     'display' => array(
    125                         'title' => single_term_title( '', FALSE ),
    126                     )
    127                 ) );
     116                // add the appropriate filter to the query
     117                $qw_query->add_handler_item('filter',
     118                    'categories',
     119                    array(
     120                        'cat_operator' => 'cat',
     121                        'cats'         => array($term->term_id => $term->name),
     122                    ))
     123                    // override the post title
     124                    ->override_options(array(
     125                        'display' => array(
     126                            'title' => single_term_title('', false),
     127                        )
     128                    ));
    128129
    129             return $qw_query;
    130         }
    131     }
     130                return $qw_query;
     131            }
     132        }
     133    }
    132134
    133135    return FALSE;
  • query-wrangler/trunk/includes/query.php

    r2302777 r2480680  
    2626
    2727    // pre_render hook
    28     $options = apply_filters( 'qw_pre_render', $options );
     28    $options = apply_filters( 'qw_pre_render', $options, $qw_query );
    2929
    3030    // get the themed content
  • query-wrangler/trunk/query-wrangler.php

    r2302781 r2480680  
    1010Author:            Jonathan Daggerhart
    1111Author URI:        http://daggerhart.com
    12 Version:           1.5.48
     12Version:           1.5.49
    1313
    1414******************************************************************
     
    3131
    3232// some useful definitions
    33 define( 'QW_VERSION', 1.548 );
     33define( 'QW_VERSION', 1.549 );
    3434define( 'QW_PLUGIN_DIR', dirname( __FILE__ ) );
    3535define( 'QW_PLUGIN_URL', plugins_url( '', __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.