Changeset 1880716
- Timestamp:
- 05/24/2018 11:19:47 AM (8 years ago)
- Location:
- basticom-framework/trunk/admin/modules
- Files:
-
- 3 edited
-
bstcmfw-cookie.php (modified) (4 diffs)
-
includes/bstcmfw-cookie.css (modified) (3 diffs)
-
includes/bstcmfw-cookie.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
basticom-framework/trunk/admin/modules/bstcmfw-cookie.php
r1880646 r1880716 10 10 11 11 // Load and parse cookie HTML 12 function bstcmfw_cookie_wrapper () { 12 function bstcmfw_cookie_wrapper () { 13 13 14 14 // If bstcmfw cookie is enabled, add cookie HTML to WP footer, check if current page != readmore url 15 if ( !is_admin() && get_option('bstcmfw-cookie-enable') == 1 && !is set( $_COOKIE['bstcmfw_cookie_accept'] ) && !is_page( get_option( 'bstcmfw-cookie-read-more-link', false, 0 ) ) ) {15 if ( !is_admin() && get_option('bstcmfw-cookie-enable') == 1 && !is_page( get_option( 'bstcmfw-cookie-read-more-link', false, 0 ) ) ) { //!isset( $_COOKIE['bstcmfw_cookie_accept'] ) && 16 16 17 17 // Get content of HTML file … … 104 104 add_action('wp_ajax_nopriv_get_scripts_hook', 'bstmcfw_get_scripts'); 105 105 106 106 /* This shit aint gonna fly */ 107 107 function bstcmfw_output_default_scripts_header() { 108 108 if(get_option('bstcmfw-cookie-enable') == 1) { … … 114 114 } 115 115 } 116 add_action('wp_head', 'bstcmfw_output_default_scripts_header');116 //add_action('wp_head', 'bstcmfw_output_default_scripts_header'); 117 117 118 118 /* This shit aint gonna fly */ 119 119 function bstcmfw_output_default_scripts_footer() { 120 120 if(get_option('bstcmfw-cookie-enable') == 1) { … … 126 126 } 127 127 } 128 add_action('wp_footer', 'bstcmfw_output_default_scripts_footer');128 //add_action('wp_footer', 'bstcmfw_output_default_scripts_footer'); 129 129 130 130 -
basticom-framework/trunk/admin/modules/includes/bstcmfw-cookie.css
r1880646 r1880716 11 11 padding: 20px; 12 12 border-radius: 2px; 13 display: none; 13 14 } 14 15 … … 19 20 display: block; 20 21 padding: 0; 22 display: block; 21 23 } 22 24 … … 55 57 background: rgba(0, 0, 0, 0.6); 56 58 z-index: 2147483646; 59 display: none; 57 60 } 58 61 -
basticom-framework/trunk/admin/modules/includes/bstcmfw-cookie.js
r1880646 r1880716 6 6 } 7 7 8 // Set default scripts based on cookie settings (1: print accept scripts, 0: print decline scripts) 9 jQuery( document ).ready( 10 function() { 11 'use strict'; 12 13 jQuery.ajax( 14 { 15 type: "POST", 16 url: bstcmfw_ajax_cookie.ajaxurl, 17 dataType: "JSON", 18 data: { 19 action: 'get_scripts_hook', 20 cookie_accept: bstcmfw_get_cookie( 'bstcmfw_cookie_accept' ) 21 }, 22 success: function( data ) { 23 jQuery( data.header ).appendTo( "head" ); 24 jQuery( data.footer ).appendTo( "body" ); 25 26 if ( 1 != bstcmfw_get_cookie( 'bstcmfw_cookie_accept' ) ) { 27 jQuery('.bstcmfw-cookie-wrapper').show(); 28 jQuery('.bstcmfw-cookie-overlay').show(); 29 } 30 31 } 32 } 33 ); 34 35 } 36 ); 8 37 9 38 // Set cookie
Note: See TracChangeset
for help on using the changeset viewer.