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_Options_Hookup

Handles hooking CMB2 forms/metaboxes into the post/attachement/user screens and handles hooking in and saving those fields.

CMB2_Hookup_Base
Extended by CMB2_Hookup
Extended by CMB2_Options_Hookup
Package: CMB2
Category: WordPress_Plugin
License: GPL-2.0+
Author: CMB2 team
Since: 2.0.0
Link: https://cmb2.io
Located at includes/CMB2_Options_Hookup.php

Methods summary

public
# __construct( CMB2 $cmb, string $option_key )

Constructor

Constructor

Parameters

$cmb
The CMB2 object to hookup.
$option_key
Option key to use.

Since

2.0.0

Overrides

CMB2_Hookup_Base::__construct
public
# hooks( )
public
# options_page_menu_hooks( )

Hook up our admin menu item and admin page.

Hook up our admin menu item and admin page.

Since

2.2.5
public
# maybe_register_message( )

If there is a message callback, let it determine how to register the message, else add a settings message if on this settings page.

If there is a message callback, let it determine how to register the message, else add a settings message if on this settings page.

Since

2.2.6
public
# options_page_output( )

Display options-page output. To override, set 'display_cb' box property.

Display options-page output. To override, set 'display_cb' box property.

Since

2.2.5
public
# options_page_tab_nav_output( )

Display options-page Tab Navigation output.

Display options-page Tab Navigation output.

Since

2.9.0
public
# maybe_output_settings_notices( )

Outputs the settings notices if a) not a sub-page of 'options-general.php' (because settings_errors() already called in wp-admin/options-head.php), and b) the 'disable_settings_errors' prop is not set or truthy.

Outputs the settings notices if a) not a sub-page of 'options-general.php' (because settings_errors() already called in wp-admin/options-head.php), and b) the 'disable_settings_errors' prop is not set or truthy.

Since

2.2.5
public array
# get_tab_group_tabs( )

Gets navigation tabs array for CMB2 options pages which share the same tab_group property.

Gets navigation tabs array for CMB2 options pages which share the same tab_group property.

Returns

array
Array of tab information ($option_key => $tab_title)

Since

2.4.0
public
# options_page_metabox( )

Display metaboxes for an options-page object.

Display metaboxes for an options-page object.

Since

2.2.5
public
# save_options( )

Save data from options page, then redirects back.

Save data from options page, then redirects back.

Since

2.2.5
public mixed
# network_get_override( mixed $test, mixed $default = false )

Replaces get_option with get_site_option.

Replaces get_option with get_site_option.

Parameters

$test
Not used.
$default
Default value to use.

Returns

mixed
Value set for the network option.

Since

2.2.5
public boolean
# network_update_override( mixed $test, mixed $option_value )

Replaces update_option with update_site_option.

Replaces update_option with update_site_option.

Parameters

$test
Not used.
$option_value
Value to use.

Returns

boolean
Success/Failure

Since

2.2.5
public static boolean
# is_page( string $page )

Determines if given page slug matches the 'page' GET query variable.

Determines if given page slug matches the 'page' GET query variable.

Parameters

$page
Page slug.

Returns

boolean

Since

2.4.0
public mixed
# __get( string $field )

Magic getter for our object.

Magic getter for our object.

Parameters

$field
Property to retrieve.

Returns

mixed

Throws

Exception
Throws an exception if the field is invalid.

Overrides

CMB2_Hookup_Base::__get

Methods inherited from CMB2_Hookup

add_context_metaboxes(), add_metaboxes(), alternate_context_postbox_classes(), can_save(), column_display(), columns_sortable(), columns_sortable_orderby(), comment_hooks(), context_box_title_markup_close(), context_box_title_markup_open(), delete_term(), do_scripts(), enqueue_cmb_css(), enqueue_cmb_js(), get_priority(), maybe_enqueue_column_display_styles(), maybe_init_and_hookup(), metabox_callback(), options_page_hooks(), output_context_metabox(), post_hooks(), postbox_classes(), register_column_headers(), register_js(), register_scripts(), register_styles(), remove_default_tax_metaboxes(), return_column_display(), save_comment(), save_post(), save_term(), save_user(), show_form_for_type(), show_on(), taxonomy_can_save(), term_hooks(), term_metabox(), universal_hooks(), user_hooks(), user_metabox(), user_new_metabox()

Methods inherited from CMB2_Hookup_Base

once()

Properties summary

protected string $object_type

The object type we are performing the hookup for

The object type we are performing the hookup for

Since

2.0.9
# 'options-page'
protected string $option_key

Options page key.

Options page key.

Since

2.2.5
# ''

Properties inherited from CMB2_Hookup

$columns, $css_registration_done, $js_registration_done, $options_hookup, $taxonomies

Properties inherited from CMB2_Hookup_Base

$cmb

Magic properties inherited from CMB2_Hookup_Base

$cmb, $object_type

CMB2 Documentation API documentation generated by ApiGen