This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
pronamic-cookies.php
79 lines (59 loc) · 1.9 KB
/
pronamic-cookies.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/*
Plugin Name: Pronamic Cookies
Plugin URI: http://pronamic.eu/wordpress-plugins/pronamic-cookies/
Description: Handy solutions to the new Cookie Law. Full site blocker or just a bar. You can also block specific sections of a page.
Version: 0.3.1
Requires at least: 3.2
Author: Pronamic
Author URI: http://pronamic.eu/
Text Domain: pronamic-cookies
Domain Path: /lang/
License: GPL
GitHub URI: https://github.com/pronamic/wp-pronamic-cookies
*/
define( 'PRONAMIC_CL_FILE', __FILE__ );
define( 'PRONAMIC_CL_BASE', dirname( PRONAMIC_CL_FILE ) );
define( 'PRONAMIC_CL_PLUGIN_DIR', basename( PRONAMIC_CL_BASE ) );
/**
* Method to load classes for this plugin
*
* @param unknown $class | string | The auto passed name of class
*/
function pronamic_cookie_autoload( $class ) {
$class = strtolower( str_replace( '_' , '-', $class ) );
$class_file = PRONAMIC_CL_BASE .'/classes/class-'. $class . '.php';
if ( file_exists( $class_file ) )
require_once $class_file;
}
spl_autoload_register( 'pronamic_cookie_autoload' );
/**
* Method to load views for this plugin
*
* @param unknown $name | string | The name of the view (with folders)
* @param unknown $vars | array | Collection of passed variables that are required in the view
* @param unknown $return | bool | Wether to show to browser or return the view as a string.
*/
function pronamic_cookie_view( $name, $vars = array(), $return = false ) {
extract( $vars );
ob_start();
include PRONAMIC_CL_BASE . DIRECTORY_SEPARATOR . $name . '.php';
if ( true === $return ) {
$buffer = ob_get_contents();
@ob_end_clean();
return $buffer;
}
ob_end_flush();
}
/**
* ===========
*
* START PLUGIN
*
* ===========
*/
include PRONAMIC_CL_BASE . '/includes/functions.php';
include PRONAMIC_CL_BASE . '/includes/deprecated.php';
$pronamic_cookie = new Pronamic_Cookies();
if ( is_admin() )
$pronamic_cookie_admin = new Pronamic_Cookies_Admin();