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_Ajax

CMB2 ajax methods (i.e. a lot of work to get oEmbeds to work with non-post objects)

Package: CMB2
Category: WordPress_Plugin
License: GPL-2.0+
Author: CMB2 team
Since: 0.9.5
Located at includes/CMB2_Ajax.php

Methods summary

public static CMB2_Ajax
# get_instance( )

Get the singleton instance of this class.

Get the singleton instance of this class.

Returns

CMB2_Ajax

Since

2.2.2
protected
# __construct( )

Constructor

Constructor

Since

2.2.0
public mixed
# oembed_handler( )

Handles our oEmbed ajax request

Handles our oEmbed ajax request

Returns

mixed
oEmbed embed code | fallback | error message

Since

0.9.5
public mixed
# get_oembed_no_edit( array $args )

Retrieves oEmbed from url/object ID

Retrieves oEmbed from url/object ID

Parameters

$args
Arguments for method.

Returns

mixed
HTML markup with embed or fallback.

Since

0.9.5
public string
# get_oembed( array $args )

Retrieves oEmbed from url/object ID

Retrieves oEmbed from url/object ID

Parameters

$args
Arguments for method.

Returns

string
HTML markup with embed or fallback.

Since

0.9.5
public mixed
# hijack_oembed_cache_get( boolean $check, integer $object_id, string $meta_key )

Hijacks retrieving of cached oEmbed. Returns cached data from relevant object metadata (vs postmeta)

Hijacks retrieving of cached oEmbed. Returns cached data from relevant object metadata (vs postmeta)

Parameters

$check
Whether to retrieve postmeta or override.
$object_id
Object ID.
$meta_key
Object metakey.

Returns

mixed
Object's oEmbed cached data.

Since

0.9.5
public boolean
# hijack_oembed_cache_set( boolean $check, integer $object_id, string $meta_key, mixed $meta_value )

Hijacks saving of cached oEmbed. Saves cached data to relevant object metadata (vs postmeta)

Hijacks saving of cached oEmbed. Saves cached data to relevant object metadata (vs postmeta)

Parameters

$check
Whether to continue setting postmeta.
$object_id
Object ID to get postmeta from.
$meta_key
Postmeta's key.
$meta_value
Value of the postmeta to be saved.

Returns

boolean
Whether to continue setting.

Since

0.9.5
protected mixed
# cache_action( string $meta_key )

Gets/updates the cached oEmbed value from/to relevant object metadata (vs postmeta).

Gets/updates the cached oEmbed value from/to relevant object metadata (vs postmeta).

Parameters

$meta_key
Postmeta's key.

Returns

mixed

Since

1.3.0
public static
# clean_stale_options_page_oembeds( string $option_key )

Hooks in when options-page data is saved to clean stale oembed cache data from the option value.

Hooks in when options-page data is saved to clean stale oembed cache data from the option value.

Parameters

$option_key
The options-page option key.

Since

2.2.0

Properties summary

protected boolean $hijack
# false
protected integer $object_id
# 0
protected array $embed_args
# array()
protected string $object_type
# 'post'
protected boolean $ajax_update
# false
protected static object $instance

Instance of this class.

Instance of this class.

Since

2.2.2
#
CMB2 Documentation API documentation generated by ApiGen