PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.4.0
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.4.0
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
better-payment / includes / Admin / Menu.php

Menu.php in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 2.4.0, at includes/Admin/Menu.php

64 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Better_Payment\Lite\Admin;
4
5 use Better_Payment\Lite\Controller;
6
7 /**
8 * Exit if accessed directly
9 */
10 if (!defined('ABSPATH')) {
11 exit;
12 }
13
14 /**
15 * Front-end legacy script loader.
16 *
17 * The backend half of this class enqueued the old PHP admin's scripts and styles
18 * on the `better-payment-settings` / `-transactions` / `-analytics` pages. Those
19 * pages no longer exist (the admin is React — see ReactAdmin), so only the
20 * front-end enqueue remains: the user-dashboard templates still rely on
21 * admin.min.js for their copy-to-clipboard buttons. The jQuery UI datepicker is
22 * Pro's (analytics report); its scripts declare that dependency themselves.
23 *
24 * @since 0.0.1
25 */
26 class Menu extends Controller{
27
28 /**
29 * Initialize the class
30 *
31 * @since 0.0.1
32 */
33 function __construct( ) {
34
35 }
36
37 /**
38 * Register the front-end enqueue.
39 *
40 * @param string $end Only 'frontend' registers anything; the parameter is kept
41 * for existing callers (Frontend passes it).
42 * @since 0.0.1
43 */
44 public function init($end = 'frontend'){
45 if('frontend' === $end){
46 add_action('wp_enqueue_scripts', array($this, 'handle_scripts_and_styles_frontend'));
47 }
48 }
49
50 /**
51 * Enqueue scripts and styles
52 *
53 * @since 0.0.1
54 */
55 public function handle_scripts_and_styles_frontend() {
56 wp_enqueue_style('toastr-css');
57
58 wp_enqueue_script('toastr-js');
59 wp_enqueue_script('better-payment-script');
60 wp_enqueue_script('bp-admin-settings');
61 wp_enqueue_script('better-payment-common-script');
62 }
63 }
64