Changeset 1821307
- Timestamp:
- 02/13/2018 02:27:36 PM (7 years ago)
- Location:
- gdy-modular-content
- Files:
-
- 72 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
gdy-modular-content/trunk/gdy-modular-content.php
r1811678 r1821307 1 1 <?php 2 2 3 3 4 4 /* … … 15 15 Domain Path: /languages 16 16 17 Version: 0.9. 217 Version: 0.9.3 18 18 19 19 */ … … 23 23 /************************************* VERSION ***********************************/ 24 24 25 define( 'GDYMC_PLUGIN_VERSION', '0.9. 2' );25 define( 'GDYMC_PLUGIN_VERSION', '0.9.3' ); 26 26 27 27 … … 140 140 141 141 142 /********************* PREVIEW **********************/142 /********************* PREVIEW COOKIES **********************/ 143 143 144 144 … … 152 152 global $current_user; 153 153 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; 170 173 171 174 endif; … … 173 176 174 177 } 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 175 192 176 193 -
gdy-modular-content/trunk/includes/functions.php
r1809931 r1821307 46 46 setcookie( $key, $value, 0, COOKIEPATH, COOKIE_DOMAIN ); 47 47 $_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 ] ); 48 58 49 59 } … … 325 335 // Fetch object information 326 336 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(); 329 339 330 340 … … 332 342 // Get objects modules 333 343 334 $moduleArray = gdymc_module_array( $objectID );344 $moduleArray = gdymc_module_array( $objectID, $objectType ); 335 345 336 346 … … 347 357 348 358 $moduleType = get_metadata( $object_type, $object_id, '_gdymc_' . $value . '_type', true ); 349 359 350 360 if( isset( $moduleTypes[ $moduleType ] ) ): 351 361 … … 361 371 362 372 373 363 374 364 375 // Filter array -
gdy-modular-content/trunk/readme.txt
r1811678 r1821307 5 5 Tested up to: 4.9 6 6 Requires PHP: 5.6 7 Stable tag: 0.9. 27 Stable tag: 0.9.3 8 8 9 9 Create and edit modular content from the frontend of your site. … … 21 21 == Changelog == 22 22 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 23 26 = 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. 25 28 26 29 = 0.9.1 = -
gdy-modular-content/trunk/scripts/gdymc_hardpreview.js
r1806895 r1821307 1 2 1 3 2 4 3
Note: See TracChangeset
for help on using the changeset viewer.