CMB2 Documentation
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hooks
  • Download Docs
  • Github

Packages

  • CMB2
  • Demo
    • CMB2
  • None
  • Tests
    • CMB2

Classes

  • CMB2
  • CMB2_Ajax
  • CMB2_Base
  • CMB2_Bootstrap_2101
  • CMB2_Boxes
  • CMB2_Display_Checkbox
  • CMB2_Display_Colorpicker
  • CMB2_Display_File
  • CMB2_Display_File_List
  • CMB2_Display_Multicheck
  • CMB2_Display_oEmbed
  • CMB2_Display_Select
  • CMB2_Display_Taxonomy_Multicheck
  • CMB2_Display_Taxonomy_Radio
  • CMB2_Display_Text_Date
  • CMB2_Display_Text_Date_Timezone
  • CMB2_Display_Text_Money
  • CMB2_Display_Text_Time
  • CMB2_Display_Text_Url
  • CMB2_Display_Textarea
  • CMB2_Display_Textarea_Code
  • CMB2_Field
  • CMB2_Field_Display
  • CMB2_Hookup
  • CMB2_Hookup_Base
  • CMB2_JS
  • CMB2_Option
  • CMB2_Options
  • CMB2_Options_Hookup
  • CMB2_REST
  • CMB2_REST_Controller
  • CMB2_REST_Controller_Boxes
  • CMB2_REST_Controller_Fields
  • CMB2_Sanitize
  • CMB2_Show_Filters
  • CMB2_Type_Base
  • CMB2_Type_Checkbox
  • CMB2_Type_Colorpicker
  • CMB2_Type_Counter_Base
  • CMB2_Type_File
  • CMB2_Type_File_Base
  • CMB2_Type_File_List
  • CMB2_Type_Multi_Base
  • CMB2_Type_Multicheck
  • CMB2_Type_Oembed
  • CMB2_Type_Picker_Base
  • CMB2_Type_Radio
  • CMB2_Type_Select
  • CMB2_Type_Select_Timezone
  • CMB2_Type_Taxonomy_Base
  • CMB2_Type_Taxonomy_Multicheck
  • CMB2_Type_Taxonomy_Multicheck_Hierarchical
  • CMB2_Type_Taxonomy_Radio
  • CMB2_Type_Taxonomy_Radio_Hierarchical
  • CMB2_Type_Taxonomy_Select
  • CMB2_Type_Taxonomy_Select_Hierarchical
  • CMB2_Type_Text
  • CMB2_Type_Text_Date
  • CMB2_Type_Text_Datetime_Timestamp
  • CMB2_Type_Text_Datetime_Timestamp_Timezone
  • CMB2_Type_Text_Time
  • CMB2_Type_Textarea
  • CMB2_Type_Textarea_Code
  • CMB2_Type_Title
  • CMB2_Type_Wysiwyg
  • CMB2_Types
  • CMB2_Utils
  • Test_CMB2_Utils_WIN

Functions

  • _tests_cmb2_manually_load_plugin
  • cmb2_ajax
  • cmb2_autoload_classes
  • cmb2_bootstrap
  • cmb2_dir
  • cmb2_do_oembed
  • cmb2_get_field
  • cmb2_get_field_value
  • cmb2_get_metabox
  • cmb2_get_metabox_form
  • cmb2_get_metabox_sanitized_values
  • cmb2_get_oembed
  • cmb2_get_option
  • cmb2_metabox_form
  • cmb2_options
  • cmb2_print_metabox_form
  • cmb2_update_option
  • cmb2_utils
  • date_create_from_format
  • date_timestamp_get
  • new_cmb2_box

Hooks

  • Hook Reference

Class CMB2_JS

Handles the dependencies and enqueueing of the CMB2 JS scripts

Direct known subclasses

Test_CMB2_JS

Package: CMB2
Category: WordPress_Plugin
License: GPL-2.0+
Author: CMB2 team
Link: https://cmb2.io
Located at includes/CMB2_JS.php

Methods summary

public static
# add_dependencies( array|string $dependencies )

Add a dependency to the array of CMB2 JS dependencies

Add a dependency to the array of CMB2 JS dependencies

Parameters

$dependencies
Array (or string) of dependencies to add.

Since

2.0.7
public static
# add_field_data( CMB2_Field $field )

Add field model data to the array for JS.

Add field model data to the array for JS.

Parameters

$field
Field object.

Since

2.4.0
public static
# enqueue( )

Enqueue the CMB2 JS

Enqueue the CMB2 JS

Since

2.0.7
public static
# register_colorpicker_alpha( boolean $enqueue = false )

Register or enqueue the wp-color-picker-alpha script.

Register or enqueue the wp-color-picker-alpha script.

Parameters

$enqueue
Whether or not to enqueue.

Since

2.2.7
public static
# register_datetimepicker( boolean $enqueue = false )

Register or enqueue the jquery-ui-datetimepicker script.

Register or enqueue the jquery-ui-datetimepicker script.

Parameters

$enqueue
Whether or not to enqueue.

Since

2.2.7
protected static
# colorpicker_frontend( )

We need to register colorpicker on the front-end

We need to register colorpicker on the front-end

Since

2.0.7
protected static
# localize( mixed $debug )

Localize the php variables for CMB2 JS

Localize the php variables for CMB2 JS

Parameters

$debug
Whether or not we are debugging.

Since

2.0.7

Properties summary

protected static string $handle

The CMB2 JS handle

The CMB2 JS handle

Since

2.0.7
# 'cmb2-scripts'
protected static string $js_variable

The CMB2 JS variable name

The CMB2 JS variable name

Since

2.0.7
# 'cmb2_l10'
protected static array $dependencies

Array of CMB2 JS dependencies

Array of CMB2 JS dependencies

Since

2.0.7
# array( 'jquery' => 'jquery', )
protected static array $fields

Array of CMB2 fields model data for JS.

Array of CMB2 fields model data for JS.

Since

2.4.0
# array()
CMB2 Documentation API documentation generated by ApiGen