PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 3.6.0
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v3.6.0
3.6.0 3.5.0 trunk 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 All 110 releases
buttonizer-multifunctional-button / init.php

init.php in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 3.6.0, at init.php

59 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * SOFTWARE LICENSE INFORMATION
4 *
5 * Copyright (c) 2017 Buttonizer, all rights reserved.
6 *
7 * This file is part of Buttonizer
8 *
9 * For detailed information regarding to the licensing of
10 * this software, please review the license.txt or visit:
11 * https://buttonizer.pro/license/
12 */
13
14 use Buttonizer\Core\Utils\Settings;
15 use Buttonizer\Core\InitBootstrap;
16
17 // Check Buttonizer Legacy enabled
18 if (
19 // Check if legacy was forced
20 Settings::getSetting("force_legacy", false) === true ||
21
22 // Check for older installations which did not yet decide
23 (Settings::getSetting("finished_setup", false) === false && get_option("buttonizer_buttons", false) !== false)
24 ) {
25 // Init legacy
26 require_once BUTTONIZER_DIR . "/legacy.php";
27 } else {
28 // Boot shared hooks (admin, redirect, page data, embed script, shortcode, admin bar, REST API)
29 InitBootstrap::boot(
30 \Buttonizer\Admin\Admin::class,
31 \Buttonizer\Api\Api::class
32 );
33
34 // Serve an absorbed plugin's own system, for sites that still run it.
35 // Before the hooks below, because the module registers its own.
36 \Buttonizer\Migration\ModuleLoader::boot();
37
38 // Absorb acquired plugins (admin only). Deliberately outside the legacy
39 // branch: a Buttonizer install that still runs its own legacy system is
40 // not in a position to take over another plugin's users.
41 \Buttonizer\Migration\MigrationManager::boot();
42
43 // Google Analytics (legacy 2.x setting, buttonizer-specific)
44 add_action('wp_enqueue_scripts', function () {
45 if (Settings::isset("google_analytics")) {
46 wp_register_script('google_analytics', 'https://www.googletagmanager.com/gtag/js?id=' . Settings::getSetting("google_analytics"), array(), false, true);
47
48 wp_enqueue_script('google_analytics');
49
50 wp_add_inline_script('google_analytics', "
51 window.dataLayer = window.dataLayer || [];
52 function gtag(){dataLayer.push(arguments);}
53 gtag('js', new Date());
54
55 gtag('config', '" . Settings::getSetting("google_analytics") . "');");
56 }
57 });
58 }
59