Class mb_ctl
Acts as an abstract class for displaying and saving controls in
metaboxes.
Direct known subclasses
ski\mb_checkbox_ctl
,
ski\mb_date_picker_ctl
,
ski\mb_text_area_ctl
,
ski\mb_text_ctl
,
ski\mb_text_notice_ctl
,
ski\mb_textbox_ctl
,
ski\mb_detail_ctl
,
ski\mb_divider_ctl
,
ski\mb_drop_ctl
,
ski\mb_media_library_ctl
,
ski\mb_number_bar_ctl
,
ski\mb_radio_image_ctl
,
ski\mb_radio_text_ctl
,
ski\mb_repeater_ctl
Namespace: ski
Located at packages/ski.web/controls/ski.wp.metabox.php
Methods summary
public
|
#
__construct( array $args = array() )
Constructor.
Parameters
- $args
array $args Can be any of the following arguments: string $slug The unique name to be
used as both the control ID and the key in the database. string $label Text that
describes a potential group of desc/control combos; usually bolded and above.
string $desc Text that describes the purpose of the control; sits on the same
line as the control. string $starting_value Used in the case there is no
database value. string $placeholder Displayed when textbox-like controls have no
value. string $text Main text that can be used next to check/radio controls, as
the 'add' button in the media library, etc array $choices Options for dropdown
and radio controls boolean $multiple Allow for multiple selections in dropdown
(TBD) and media library controls integer $range_min Minimum value allowed
typically for constrained controls integer $range_max Maximum value allowed
typically for constrained controls integer $range_step Amount to change the
value typically for constrained controls string $status Can be one of the
following values: info, caution, fail boolean $allow_html Setting to false not
permit HTML to make it into the control value string $repeat_ctl The name of the
mb_ctl class that will be repeated one under the other integer $repeat_num The
maximum number of times the $repeat_ctl can be repeated; use -1 for infinite
|
public
|
#
hook( )
Offers an opportunity to hook into actions/filter - expecting child classes
to implement.
Offers an opportunity to hook into actions/filter - expecting child classes
to implement.
|
public
|
#
enqueue( )
Offers an opportunity to queue up CSS/JS - this is a stub for derived
classes.
Offers an opportunity to queue up CSS/JS - this is a stub for derived
classes.
|
public
|
#
render( type $post_id )
Displays this control - this is a stub for derived classes.
Displays this control - this is a stub for derived classes.
Parameters
- $post_id
type $post_id The ID of the current post.
|
public
string
|
#
prepare_post_value( )
Preps the corresponding POST value.
Preps the corresponding POST value.
Returns
string The prepared value from the POST
Link
|
public
string
|
#
get_slug( )
Accessor for the unqiue slug.
Accessor for the unqiue slug.
Returns
string This object's slug value
|
public
|
#
get_label_markup( )
The label should be uniform for every control - so just lay it out once and
reference it from the render callbacks everywhere.
The label should be uniform for every control - so just lay it out once and
reference it from the render callbacks everywhere.
|
public
|
#
get_desc_markup( )
The description should be uniform for every control - so just lay it out once
and reference it from the render callbacks everywhere.
The description should be uniform for every control - so just lay it out once
and reference it from the render callbacks everywhere.
|
Magic methods summary