PluginProbe
Lawwwing | Textos legales web y Banner de cookies / trunk
Lawwwing | Textos legales web y Banner de cookies vtrunk
1.5.3 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 All 59 releases
ibamu / integrations / wp_consent_api.php

wp_consent_api.php in Lawwwing | Textos legales web y Banner de cookies trunk, at integrations/wp_consent_api.php

55 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Tell the consent API we're following the api
5 */
6 $plugin = 'ibamu/ibamu.php';
7 add_filter( "wp_consent_api_registered_$plugin", function () {
8 return true;
9 });
10
11
12 /**
13 * Tell plugins to wait for the consenttype to be set
14 */
15 function lawwwing_wp_waitfor_consenttype( $waitfor ) {
16 return $waitfor;
17 }
18 add_filter( 'wp_consent_api_waitfor_consent_hook', 'lawwwing_wp_waitfor_consenttype' );
19
20 /**
21 * WP Consent API
22 */
23 function lawwwing_consent_api_add_consent_types( $consenttypes ) {
24 return []; // Don't add any new consent types by now.
25 }
26 add_filter( 'wp_consent_types', 'lawwwing_consent_api_add_consent_types' );
27
28
29 function lawwwing_consent_api_get_consenttype( $consenttype ) {;
30 return "optin"; // Set the consent type to "optin"
31 }
32 add_filter( 'wp_get_consent_type', 'lawwwing_consent_api_get_consenttype' );
33
34
35 //---------------------
36
37 // add_filter('wp_footer', 'lawwwing_consent_api_footer', 10, 1);
38 // function lawwwing_consent_api_footer( $content ) {
39 // // Output debug information in HTML format
40 // echo '<div style="background-color: #f9f9f9; border: 1px solid #ddd; padding: 10px; margin: 10px 0;">';
41 // echo '<strong>Consent Debug Information:</strong><br>';
42 // echo 'Consent Type: ' . wp_get_consent_type() . '<br>';
43 // echo 'Expiration cookie: ' . wp_consent_api_cookie_expiration() . '<br>';
44 // echo 'Check if a plugin is registered for the WP Consent API: ' . consent_api_registered(LW_PLUGIN_REFERENCE) . '<br>';
45 // echo 'Marketing: ' . (wp_has_consent('marketing') ? 'Yes' : 'No') . '<br>';
46 // echo 'Statistics: ' . (wp_has_consent('statistics') ? 'Yes' : 'No') . '<br>';
47 // echo 'Statistics-anonymous: ' . (wp_has_consent('statistics-anonymous') ? 'Yes' : 'No') . '<br>';
48 // echo 'Functional: ' . (wp_has_consent('functional') ? 'Yes' : 'No') . '<br>';
49 // echo 'Preferences: ' . (wp_has_consent('preferences') ? 'Yes' : 'No') . '<br>';
50 // echo '</div>';
51 // return $content;
52 // }
53
54 ?>
55