interface MetaboxInterface (View source)

Methods

string
getId()

Return the metabox id.

setTitle(string $title)

Set the metabox title.

string
getTitle()

Return the metabox title.

setScreen($screen)

Set the metabox screen.

string|array|WP_Screen
getScreen()

Return the metabox screen.

setContext(string $context)

Set the metabox context.

string
getContext()

Get the metabox context.

setPriority(string $priority)

Set the metabox priority.

string
getPriority()

Get the metabox priority.

setCallback(string|callable $callback)

Set the metabox callback.

string|callable|array
getCallback()

Return the metabox callback.

setArguments(array $args)

Set the metabox controller arguments.

array
getArguments()

Return the metabox arguments.

setLayout(string $layout)

Set the metabox layout.

string
getLayout()

Return the metabox layout.

set()

Set the metabox for display.

setResource(MetaboxResourceInterface $resource)

Set the metabox resource abstraction layer/manager.

getResource()

Return the metabox resource manager.

array
toArray()

Return the metabox as an array resource.

string
toJson()

Return the metabox as a JSON resource.

setLocale(string $locale)

Set the metabox locale.

string
getLocale()

Return the metabox locale.

setPrefix(string $prefix)

Set the metabox prefix.

string
getPrefix()

Return the metabox prefix.

repository()

Return the metabox fields repository instance.

add(FieldTypeInterface|SectionInterface $field, SectionInterface $section = null)

Add a field or section of fields to the metabox.

array
getTranslations()

Return the metabox translations.

string
getTranslation(string $key)

Return the translation if exists.

addTranslation(string $key, string $translation)

Add metabox translation.

setCapability(string $cap)

Set the metabox capability.

string
getCapability()

Return the metabox capability.

setTemplate(string|array $template, string $screen = 'page')

Set the metabox template.

array
getTemplate()

Return the metabox template.

Details

string getId()

Return the metabox id.

Return Value

string

MetaboxInterface setTitle(string $title)

Set the metabox title.

Parameters

string $title

Return Value

MetaboxInterface

string getTitle()

Return the metabox title.

Return Value

string

MetaboxInterface setScreen($screen)

Set the metabox screen.

Parameters

$screen

Return Value

MetaboxInterface

string|array|WP_Screen getScreen()

Return the metabox screen.

Return Value

string|array|WP_Screen

MetaboxInterface setContext(string $context)

Set the metabox context.

Parameters

string $context

Return Value

MetaboxInterface

string getContext()

Get the metabox context.

Return Value

string

MetaboxInterface setPriority(string $priority)

Set the metabox priority.

Parameters

string $priority

Return Value

MetaboxInterface

string getPriority()

Get the metabox priority.

Return Value

string

MetaboxInterface setCallback(string|callable $callback)

Set the metabox callback.

Parameters

string|callable $callback

Return Value

MetaboxInterface

string|callable|array getCallback()

Return the metabox callback.

Return Value

string|callable|array

MetaboxInterface setArguments(array $args)

Set the metabox controller arguments.

Parameters

array $args

Return Value

MetaboxInterface

array getArguments()

Return the metabox arguments.

Return Value

array

MetaboxInterface setLayout(string $layout)

Set the metabox layout.

Parameters

string $layout

Return Value

MetaboxInterface

string getLayout()

Return the metabox layout.

Return Value

string

MetaboxInterface set()

Set the metabox for display.

Return Value

MetaboxInterface

MetaboxInterface setResource(MetaboxResourceInterface $resource)

Set the metabox resource abstraction layer/manager.

Parameters

MetaboxResourceInterface $resource

Return Value

MetaboxInterface

MetaboxResourceInterface getResource()

Return the metabox resource manager.

array toArray()

Return the metabox as an array resource.

Return Value

array

string toJson()

Return the metabox as a JSON resource.

Return Value

string

MetaboxInterface setLocale(string $locale)

Set the metabox locale.

Parameters

string $locale

Return Value

MetaboxInterface

string getLocale()

Return the metabox locale.

Return Value

string

MetaboxInterface setPrefix(string $prefix)

Set the metabox prefix.

Parameters

string $prefix

Return Value

MetaboxInterface

string getPrefix()

Return the metabox prefix.

Return Value

string

FieldsRepositoryInterface repository()

Return the metabox fields repository instance.

MetaboxInterface add(FieldTypeInterface|SectionInterface $field, SectionInterface $section = null)

Add a field or section of fields to the metabox.

Parameters

FieldTypeInterface|SectionInterface $field
SectionInterface $section

Return Value

MetaboxInterface

array getTranslations()

Return the metabox translations.

Return Value

array

string getTranslation(string $key)

Return the translation if exists.

Parameters

string $key

Return Value

string

MetaboxInterface addTranslation(string $key, string $translation)

Add metabox translation.

Parameters

string $key
string $translation

Return Value

MetaboxInterface

MetaboxInterface setCapability(string $cap)

Set the metabox capability.

Parameters

string $cap

Return Value

MetaboxInterface

string getCapability()

Return the metabox capability.

Return Value

string

MetaboxInterface setTemplate(string|array $template, string $screen = 'page')

Set the metabox template.

Parameters

string|array $template
string $screen

Return Value

MetaboxInterface

array getTemplate()

Return the metabox template.

Return Value

array