PluginProbe
Hello Plus / 1.7.3
Hello Plus v1.7.3
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / admin / components / admin-controller.php

admin-controller.php in Hello Plus 1.7.3, at modules/admin/components/admin-controller.php

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace HelloPlus\Modules\Admin\Components;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Admin_Controller {
10
11 public function plugin_row_meta( $plugin_meta, $plugin_file ) {
12 if ( HELLOPLUS_PLUGIN_BASE === $plugin_file ) {
13 $row_meta = [
14 'changelog' => '<a href="#" id="hello-plus-whats-new-link" aria-label="' . esc_attr( esc_html__( 'Changelog', 'hello-plus' ) ) . '" >' . esc_html__( 'Changelog', 'hello-plus' ) . '</a><div id="hello-plus-whats-new"></div>',
15 ];
16
17 $plugin_meta = array_merge( $plugin_meta, $row_meta );
18 }
19
20 return $plugin_meta;
21 }
22
23 public function maybe_init_cart() {
24 $has_cart = is_a( WC()->cart, 'WC_Cart' );
25 if ( ! $has_cart ) {
26 $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
27 WC()->session = new $session_class();
28 WC()->session->init();
29 WC()->cart = new \WC_Cart();
30 WC()->customer = new \WC_Customer( get_current_user_id(), true );
31 }
32 }
33
34
35 public function __construct() {
36 add_filter( 'plugin_row_meta', [ $this, 'plugin_row_meta' ], 10, 2 );
37 add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'maybe_init_cart' ] );
38 }
39 }
40