Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Load scripts and styles in footer #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion classes/class-pronamic-cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function __construct() {
add_action( 'template_redirect', array( $this, 'blocker' ) );

add_action( 'wp_footer', array( $this, 'show_message' ) );
add_action( 'wp_footer', array( $this, 'enqueue_style' ) );

}

Expand All @@ -28,11 +29,14 @@ public function init() {

public function styles() {
wp_register_style( 'pronamic_cookie_style', plugins_url( PRONAMIC_CL_PLUGIN_DIR . '/assets/pronamic-cookie-law-style.css' ) );
}

public function enqueue_style() {
wp_enqueue_style( 'pronamic_cookie_style' );
}

public function scripts() {
wp_register_script( 'pronamic_cookie_js', plugins_url( PRONAMIC_CL_PLUGIN_DIR . '/assets/pronamic-cookie-law.js' ), array( 'jquery' ) );
wp_register_script( 'pronamic_cookie_js', plugins_url( PRONAMIC_CL_PLUGIN_DIR . '/assets/pronamic-cookie-law.js' ), array( 'jquery' ), false, true );
wp_enqueue_script( 'pronamic_cookie_js' );

$setting_expire = get_option( 'pronamic_cookie_options_advanced_expires', '1 year' );
Expand Down