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

Packages

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

Classes

  • Test_CMB2
  • Test_CMB2_Ajax
  • Test_CMB2_Core
  • Test_CMB2_Field
  • Test_CMB2_JS
  • Test_CMB2_Object
  • Test_CMB2_Options
  • Test_CMB2_REST
  • Test_CMB2_Rest_Base
  • Test_CMB2_REST_Controllers
  • Test_CMB2_REST_Object
  • Test_CMB2_REST_Registered_Fields
  • Test_CMB2_Types
  • Test_CMB2_Types_Base
  • Test_CMB2_Types_Display
  • Test_CMB2_Utils

Exceptions

  • Test_CMB2_Exception

Hooks

  • Hook Reference

Class Test_CMB2_REST_Object

Make some things accessible in the CMB2_REST class.

CMB2_Hookup_Base
Extended by CMB2_REST
Extended by Test_CMB2_REST_Object
Package: Tests\CMB2
License: GPL-2.0+
Author: CMB2 team
Located at tests/cmb-rest-tests-base.php

Methods summary

public
# declare_read_edit_fields( )

Setup readable and editable fields.

Setup readable and editable fields.

Since

2.2.3

Overrides

CMB2_REST::declare_read_edit_fields
public boolean
# can_read( boolean $show_in_rest )

Determines if a field is readable based on it's show_in_rest value and the box's show_in_rest value.

Determines if a field is readable based on it's show_in_rest value and the box's show_in_rest value.

Parameters

$show_in_rest
Field's show_in_rest value. Default null.

Returns

boolean
Whether field is readable.

Since

2.2.3

Overrides

CMB2_REST::can_read
public boolean
# can_edit( boolean $show_in_rest )

Determines if a field is editable based on it's show_in_rest value and the box's show_in_rest value.

Determines if a field is editable based on it's show_in_rest value and the box's show_in_rest value.

Parameters

$show_in_rest
Field's show_in_rest value. Default null.

Returns

boolean
Whether field is editable.

Since

2.2.3

Overrides

CMB2_REST::can_edit
public static integer
# get_object_id( mixed $object, string $object_type = 'post' )

Get the object ID for the given object/type.

Get the object ID for the given object/type.

Parameters

$object
The object to get the ID for.
$object_type
The object type we are looking for.

Returns

integer
The object ID if found.

Since

2.2.3

Overrides

CMB2_REST::get_object_id
public static
# reset_boxes( )
public static
# reset_type_boxes( )

Methods inherited from CMB2_REST

__construct(), __get(), field_can(), field_can_edit(), field_can_read(), get_all(), get_box_rest_values(), get_comment_rest_values(), get_post_rest_values(), get_rest_box(), get_rest_values(), get_term_rest_values(), get_user_rest_values(), init_routes(), is_editable(), is_protected_meta(), is_readable(), maybe_init_and_hookup(), register_cmb2_fields(), register_rest_field(), remove(), sanitize_box_values(), sanitize_field_value(), sanitize_group_value(), santize_box_rest_values(), universal_hooks(), update_comment_rest_values(), update_post_rest_values(), update_rest_values(), update_term_rest_values(), update_user_rest_values()

Methods inherited from CMB2_Hookup_Base

once()

Constants summary

Constants inherited from CMB2_REST

NAME_SPACE, VERSION

Properties summary

Properties inherited from CMB2_REST

$boxes, $cmb, $edit_fields, $read_fields, $rest_edit, $rest_read, $type_boxes

Properties inherited from CMB2_Hookup_Base

$object_type

Magic properties inherited from CMB2_Hookup_Base

$cmb, $object_type

CMB2 Documentation API documentation generated by ApiGen