Plugin Directory

Changeset 3219572


Ignore:
Timestamp:
01/09/2025 11:30:43 AM (15 months ago)
Author:
cookiehub
Message:

WP Consent API integrated

Location:
cookiehub/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • cookiehub/trunk/changelog.txt

    r3198183 r3219572  
    11=== CookieHub ===
     2
     3= 1.2.0 =
     4*Release Date - 9 January 2025*
     5
     6WP Consent API support integrated
    27
    38= 1.1.5 =
  • cookiehub/trunk/cookiehub.php

    r3198183 r3219572  
    44Plugin URI: https://www.cookiehub.com/wordpress
    55Description: Take control effortlessly with CookieHub – GDPR-compliant solution for cookie management and compliance.
    6 Version: 1.1.5
     6Version: 1.2.0
    77Author: CookieHub
    88Author URI: https://www.cookiehub.com/
     
    4646    }
    4747}
     48
     49function my_plugin_enqueue_script() {
     50    if (function_exists( 'wp_has_consent' )) {
     51        wp_register_script( 'dcc_wp_consent', plugins_url( 'includes/js/dcc-wp-consent.js?1.2.0', __FILE__ ),  null ,'', false);
     52        wp_enqueue_script('dcc_wp_consent');
     53    }
     54}
     55add_action('wp_enqueue_scripts', 'my_plugin_enqueue_script');
     56
     57function custom_get_consent_type() {
     58    return 'optin';
     59}
     60add_filter('wp_get_consent_type', 'custom_get_consent_type');
  • cookiehub/trunk/includes/ch-admin.php

    r3000646 r3219572  
    5151    public function dcchub_page_init()
    5252    {   
    53         wp_register_style( 'dcchub_style', plugins_url( '/css/dcchub-admin.css?1.0.2', __FILE__ ));
     53        wp_register_style( 'dcchub_style', plugins_url( '/css/dcchub-admin.css?1.2.0', __FILE__ ));
    5454        wp_enqueue_style('dcchub_style');     
    55         wp_register_script( 'dcchub_test', plugins_url( '/js/dcchub-test.js?1.0.2', __FILE__ ),  array ('jquery') ,'', false);
     55        wp_register_script( 'dcchub_test', plugins_url( '/js/dcchub-test.js?1.2.0', __FILE__ ),  array ('jquery') ,'', false);
    5656        wp_enqueue_script('dcchub_test');
    5757        wp_localize_script('my-script', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
  • cookiehub/trunk/includes/ch-generate.php

    r3141575 r3219572  
    3232                }
    3333               
    34                 $cpm = "language: '" . $lang . "'";
     34                $cpm = "language: '" . $lang . "',";
     35            }
     36           
     37            if (function_exists( 'wp_has_consent' )) {
     38                $onAllow = "onAllow: function(category) {
     39                    if (typeof wpConsentProxy === 'function') { wpConsentProxy(category, 'allow') };
     40                },";
     41
     42                $onRevoke = "onRevoke: function(category) {
     43                    if (typeof wpConsentProxy === 'function') { wpConsentProxy(category, 'deny') };
     44                }";
    3545            }
    3646           
     
    3848    }
    3949   
    40     return $cpm;
     50    return $cpm . $onAllow . $onRevoke;
    4151}
    4252
  • cookiehub/trunk/readme.txt

    r3198183 r3219572  
    44Requires at least: 5.2
    55Tested up to: 6.7.1
    6 Stable tag: 1.1.5
     6Stable tag: 1.2.0
    77License: GPLv2 or later
    88
     
    135135== Changelog ==
    136136
     137= 1.2.0 =
     138*Release Date - 9 January 2025*
     139
     140WP Consent API support integrated
     141
    137142= 1.1.5 =
    138143*Release Date - 27 November 2024*
Note: See TracChangeset for help on using the changeset viewer.