Plugin Directory

Changeset 1905033


Ignore:
Timestamp:
07/06/2018 07:14:38 AM (8 years ago)
Author:
markwt
Message:

1.5.9 - issue with the plugin interfering with breadcrumb fixed.

Location:
cookie-law-info
Files:
51 added
6 edited

Legend:

Unmodified
Added
Removed
  • cookie-law-info/trunk/admin/cli-admin-page.php

    r1885932 r1905033  
    845845                // Store sanitised values only:
    846846
    847                 $stored_options[$key] = wp_unslash($_POST[$key]);
     847                $stored_options[$key] = sanitize_textarea_field(wp_unslash($_POST[$key]));
    848848            }
    849849        }
  • cookie-law-info/trunk/cookie-law-info.php

    r1899112 r1905033  
    66Author: webtoffee
    77Author URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
    8 Version: 1.5.8
     8Version: 1.5.9
    99License: GPL2
    1010Text Domain: cookie-law-info
     
    111111   
    112112    // Bye bye custom meta:
    113     global $post;
    114113    $args = array('post_type' => 'cookielawinfo');
    115     $cookies = new WP_Query( $args );
     114    $posts = get_posts($args);
    116115   
    117     if ( !$cookies->have_posts() ) {
     116    if ( !$posts ) {
    118117        return;
    119118    }
    120119   
    121     while ( $cookies->have_posts() ) : $cookies->the_post();
    122         // Get custom fields:
    123         $custom = get_post_custom( $post->ID );
     120        if( $posts )
     121    {
     122            foreach( $posts as $post )
     123            {
     124                $custom = get_post_custom( $post->ID );
    124125        // Look for old values. If they exist, move them to new values then delete old values:
    125126        if ( isset ( $custom["cookie_type"][0] ) ) {
     
    135136            delete_post_meta( $post->ID, "_cli_cookie_duration", $custom["_cli_cookie_duration"][0] );
    136137        }
    137     endwhile;
     138            }
     139        }
     140   
    138141}
    139142
  • cookie-law-info/trunk/js/cookielawinfo.js

    r1899112 r1905033  
    11function cli_show_cookiebar(p) {
    2     /* plugin version 1.5.8 */
     2    /* plugin version 1.5.9 */
    33    var Cookie = {
    44        set: function(name,value,days) {
  • cookie-law-info/trunk/php/functions.php

    r1885932 r1905033  
    133133         * Force reload
    134134         */
    135         $version = '1.5.4';
     135        $version = '1.5.9';
    136136       
    137137        wp_register_style( 'cookielawinfo-style', CLI_PLUGIN_URL . 'css/cli-style.css', null, $version );
     
    150150
    151151
    152 function get_non_necessary_cookie_ids(){
     152function get_non_necessary_cookie_ids() {
    153153    global $wpdb;
    154    
    155         $args = array(
    156             'post_type' => 'cookielawinfo',
    157             'meta_query' => array(
    158         array(
    159             'key' => '_cli_cookie_sensitivity',
    160             'value' => 'non-necessary'
    161         )
    162     )
    163            
    164             );
    165     $cookies = new WP_Query( $args );
    166    
    167     if ( !$cookies->have_posts() ) {
    168         return;
    169     }
    170         $cookie_slugs = array();
    171        
    172         while($cookies->have_posts()):
    173            
    174             $cookies->the_post();
    175             global $post;
    176             $cookie_slugs[] = get_post_meta( $post->ID, "_cli_cookie_slugid", true);
    177            
    178         endwhile;
    179        
    180         return $cookie_slugs;
     154
     155    $args = array(
     156        'post_type' => 'cookielawinfo',
     157        'meta_query' => array(
     158            array(
     159                'key' => '_cli_cookie_sensitivity',
     160                'value' => 'non-necessary'
     161            )
     162        )
     163    );
     164    $posts = get_posts($args);
     165
     166    if (!$posts) {
     167        return;
     168    }
     169    $cookie_slugs = array();
     170
     171    if ($posts) {
     172        foreach ($posts as $post) {
     173            $cookie_slugs[] = get_post_meta($post->ID, "_cli_cookie_slugid", true);
     174        }
     175    }
     176
     177    return $cookie_slugs;
    181178}
    182179
  • cookie-law-info/trunk/php/shortcodes.php

    r1883791 r1905033  
    7171    ), $atts ) );
    7272   
    73     global $post;
    7473   
    7574    $args = array(
     
    8079        'orderby' => 'title'
    8180    );
    82     $cookies = new WP_Query( $args );
     81    $posts = get_posts($args);
    8382   
    8483    $ret = '<table class="cookielawinfo-' . $style . '"><thead><tr>';
     
    9796    $ret .= '</thead><tbody>';
    9897   
    99     if ( !$cookies->have_posts() ) {
    100         $ret .= '<tr class="cookielawinfo-row"><td colspan="2" class="cookielawinfo-column-empty">' . $not_shown_message . '</td></tr>';
    101     }
    102    
    103     while ( $cookies->have_posts() ) : $cookies->the_post();
    104         // Get custom fields:
     98    if ( !$posts ) {
     99        $ret .= '<tr class="cookielawinfo-row"><td colspan="4" class="cookielawinfo-column-empty">' . $not_shown_message . '</td></tr>';
     100    }
     101        if( $posts )
     102    {
     103        foreach( $posts as $post )
     104            {
    105105        $custom = get_post_custom( $post->ID );
    106106        $cookie_type = ( isset ( $custom["_cli_cookie_type"][0] ) ) ? $custom["_cli_cookie_type"][0] : '';
    107107        $cookie_duration = ( isset ( $custom["_cli_cookie_duration"][0] ) ) ? $custom["_cli_cookie_duration"][0] : '';
    108108        // Output HTML:
    109         $ret .= '<tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">' . get_the_title() . '</td>';
     109        $ret .= '<tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">' . $post->post_title . '</td>';
    110110        $ret .= '<td class="cookielawinfo-column-2">' . $cookie_type .'</td>';
    111111        $ret .= '<td class="cookielawinfo-column-3">' . $cookie_duration .'</td>';
    112         $ret .= '<td class="cookielawinfo-column-4">' . get_the_content() .'</td>';
     112        $ret .= '<td class="cookielawinfo-column-4">' . $post->post_content .'</td>';
     113        $ret = apply_filters('cli_new_column_values_to_audit_table',$ret, $custom);
    113114        $ret .= '</tr>';
    114     endwhile;
     115
     116        }
     117    }
    115118    $ret .= '</tbody></table>';
    116119    return $ret;
     120   
    117121}
    118122
  • cookie-law-info/trunk/readme.txt

    r1899124 r1905033  
    55Requires at least: 3.3.1
    66Tested up to: 4.9.6
    7 Stable tag: 1.5.8
     7Stable tag: 1.5.9
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    167167== Changelog ==
    168168
     169= 1.5.9 =
     170
     171* Issue with the plugin interfering with breadcrumb fixed.
     172
    169173= 1.5.8 =
    170174
    171 * Support for <u> in the message bar.
     175* Support for underline tag in the message bar.
    172176
    173177= 1.5.7 =
     
    270274== Upgrade Notice ==
    271275
    272 = 1.5.8 =
    273 
    274 * Support for <u> in the message bar.
     276= 1.5.9 =
     277
     278* Issue with the plugin interfering with breadcrumb fixed.
     279
     280
Note: See TracChangeset for help on using the changeset viewer.