Plugin Directory

Changeset 1821307


Ignore:
Timestamp:
02/13/2018 02:27:36 PM (7 years ago)
Author:
Grandy
Message:

version 0.9.3

Location:
gdy-modular-content
Files:
72 added
4 edited

Legend:

Unmodified
Added
Removed
  • gdy-modular-content/trunk/gdy-modular-content.php

    r1811678 r1821307  
    11<?php
    2    
     2
    33   
    44    /*
     
    1515        Domain Path: /languages
    1616
    17         Version: 0.9.2
     17        Version: 0.9.3
    1818   
    1919    */
     
    2323    /************************************* VERSION ***********************************/
    2424
    25     define( 'GDYMC_PLUGIN_VERSION', '0.9.2' );
     25    define( 'GDYMC_PLUGIN_VERSION', '0.9.3' );
    2626
    2727
     
    140140
    141141
    142     /********************* PREVIEW **********************/
     142    /********************* PREVIEW COOKIES **********************/
    143143
    144144
     
    152152        global $current_user;
    153153
    154 
    155         if( !is_user_logged_in() OR ( isset( $_GET[ 'gdymc_hardpreview' ] ) AND $_GET[ 'gdymc_hardpreview' ] == 0 ) ):
    156 
    157 
    158             gdymc_set_cookie( 'gdymc_hardpreview', 0 );
    159             gdymc_set_cookie( 'gdymc_softpreview', 0 );
    160 
    161 
    162         elseif( ( isset( $_COOKIE[ 'gdymc_hardpreview' ] ) AND $_COOKIE[ 'gdymc_hardpreview' ] == 1 AND !is_admin() AND $GLOBALS[ 'pagenow' ] != 'wp-login.php' ) OR ( isset( $_GET[ 'gdymc_hardpreview' ] ) AND $_GET[ 'gdymc_hardpreview' ] == 1 ) ):
    163 
    164 
    165             gdymc_set_cookie( 'gdymc_hardpreview', 1 );
    166             gdymc_set_cookie( 'gdymc_softpreview', 0 );
    167 
    168             $current_user = new WP_User();
    169 
     154        if( is_user_logged_in() ):
     155
     156            if( isset( $_GET[ 'gdymc_hardpreview' ] ) AND $_GET[ 'gdymc_hardpreview' ] == 0 ):
     157
     158
     159                gdymc_remove_cookie( 'gdymc_hardpreview' );
     160                gdymc_remove_cookie( 'gdymc_softpreview' );
     161
     162
     163            elseif( ( isset( $_COOKIE[ 'gdymc_hardpreview' ] ) AND $_COOKIE[ 'gdymc_hardpreview' ] == 1 AND !is_admin() AND $GLOBALS[ 'pagenow' ] != 'wp-login.php' ) OR ( isset( $_GET[ 'gdymc_hardpreview' ] ) AND $_GET[ 'gdymc_hardpreview' ] == 1 ) ):
     164
     165
     166                gdymc_set_cookie( 'gdymc_hardpreview', 1 );
     167                gdymc_remove_cookie( 'gdymc_softpreview' );
     168
     169                $current_user = new WP_User();
     170
     171
     172            endif;
    170173
    171174        endif;
     
    173176
    174177    }
     178
     179
     180
     181    // Remove cookies on logout
     182
     183    add_action( 'wp_logout', 'gdymc_preview_reset' );
     184
     185    function gdymc_preview_reset() {
     186       
     187        gdymc_remove_cookie( 'gdymc_hardpreview' );
     188        gdymc_remove_cookie( 'gdymc_softpreview' );
     189       
     190    }
     191
    175192   
    176193
  • gdy-modular-content/trunk/includes/functions.php

    r1809931 r1821307  
    4646        setcookie( $key, $value, 0, COOKIEPATH, COOKIE_DOMAIN );
    4747        $_COOKIE[ $key ] = $value;
     48
     49    }
     50
     51
     52    // Removes a cookie
     53
     54    function gdymc_remove_cookie( $key ) {
     55
     56        setcookie( $key, null, -1, COOKIEPATH, COOKIE_DOMAIN );
     57        unset( $_COOKIE[ $key ] );
    4858
    4959    }
     
    325335        // Fetch object information
    326336
    327         $object_id = is_numeric( $objectID ) ? $objectID : gdymc_object_id();
    328         $object_type = is_numeric( $objectType ) ? $objectType : gdymc_object_type();
     337        $object_id = $objectID ? $objectID : gdymc_object_id();
     338        $object_type = $objectType ? $objectType : gdymc_object_type();
    329339
    330340
     
    332342        // Get objects modules
    333343       
    334         $moduleArray = gdymc_module_array( $objectID );
     344        $moduleArray = gdymc_module_array( $objectID, $objectType );
    335345       
    336346
     
    347357           
    348358            $moduleType = get_metadata( $object_type, $object_id, '_gdymc_' . $value . '_type', true );
    349            
     359
    350360            if( isset( $moduleTypes[ $moduleType ] ) ):
    351361               
     
    361371
    362372
     373
    363374       
    364375        // Filter array
  • gdy-modular-content/trunk/readme.txt

    r1811678 r1821307  
    55Tested up to: 4.9
    66Requires PHP: 5.6
    7 Stable tag: 0.9.2
     7Stable tag: 0.9.3
    88
    99Create and edit modular content from the frontend of your site.
     
    2121== Changelog ==
    2222
     23= 0.9.3 =
     24* The plugins only sets cookies when you are logged in and as soon as you logout the plugin removes its cookies. This removes the cookie footprint for regular users completely wich is better for the stricter privacy guidlines now and in the future.
     25
    2326= 0.9.2 =
    24 * Removed the `gdymc_automatic_module_area` filter wich causes problems with multiple areas on one page.
     27* Removed the `gdymc_automatic_module_area` filter wich causes problems with multiple areas on one page. This results in some cases in the main area not being rendered.
    2528
    2629= 0.9.1 =
  • gdy-modular-content/trunk/scripts/gdymc_hardpreview.js

    r1806895 r1821307  
    1 
    2    
     1       
    32       
    43
Note: See TracChangeset for help on using the changeset viewer.