PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 5.8.6
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v5.8.6
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
automatorwp / libraries / cmb2-field-switch / cmb2-field-switch.php

cmb2-field-switch.php in AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI 5.8.6, at libraries/cmb2-field-switch/cmb2-field-switch.php

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package RGC\CMB2\Field_Switch
4 * @author Ruben Garcia (RubenGC) <[email protected]>, GamiPress <[email protected]>
5 * @copyright Copyright (c) GamiPress
6 *
7 * Plugin Name: CMB2 Field Type: Switch
8 * Plugin URI: https://github.com/rubengc/cmb2-field-switch
9 * GitHub Plugin URI: https://github.com/rubengc/cmb2-field-switch
10 * Description: CMB2 field to make checkboxes and radios look as a WordPress Gutenberg switch.
11 * Version: 1.0.0
12 * Author: GamiPress
13 * Author URI: https://gamipress.com/
14 * License: GPLv2+
15 */
16 // Exit if accessed directly
17 if( !defined( 'ABSPATH' ) ) exit;
18
19 global $cmb2_field_switch;
20
21 // Prevent CMB2 autoload adding "RGC_" at start
22 if( ! class_exists( 'RGC_CMB2_Field_Switch' ) ) {
23
24 /**
25 * Class RGC_CMB2_Field_Switch
26 */
27 class RGC_CMB2_Field_Switch {
28
29 /**
30 * Current version number
31 */
32 const VERSION = '1.0.0';
33
34 /**
35 * Initialize the plugin by hooking into CMB2
36 */
37 public function __construct() {
38
39 add_action( 'admin_enqueue_scripts', array( $this, 'setup_admin_scripts' ) );
40
41 }
42
43 /**
44 * Enqueue scripts and styles
45 */
46 public function setup_admin_scripts() {
47
48 // CSS needs to be enqueued
49 wp_enqueue_style( 'cmb-switch-css', plugins_url( 'switch.css', __FILE__ ), array(), self::VERSION );
50
51 }
52
53 }
54
55 $cmb2_field_switch = new RGC_CMB2_Field_Switch();
56
57 }