Metabox_API
Metabox API class.
Namespace: WebberZone\Image_Optimizer\Admin\Settings
Since: 1.0.0
Source: includes/admin/settings/class-metabox-api.php line 20
Methods
__construct()
Main constructor class.
Line: 84
public function __construct( $args );
| Type | Name | Description |
|---|---|---|
array|string |
$args |
{ |
add_meta_boxes()
Function to add the metabox.
Line: 108
public function add_meta_boxes( );
admin_enqueue_scripts()
Enqueue scripts and styles.
Line: 124
public function admin_enqueue_scripts( $hook );
| Type | Name | Description |
|---|---|---|
string |
$hook |
The current admin page. |
enqueue_scripts_styles() static
Enqueues all scripts, styles, settings, and templates necessary to use the Settings API.
Line: 141
static public function enqueue_scripts_styles( $prefix, $args = ... );
| Type | Name | Description |
|---|---|---|
string |
$prefix |
Prefix which is used for creating the unique filters and actions. |
array |
$args |
Array of arguments. |
save()
Function to save the metabox.
Line: 150
public function save( $post_id );
| Type | Name | Description |
|---|---|---|
int|string |
$post_id |
Post ID. |
html()
Function to display the metabox.
Line: 236
public function html( $post );
| Type | Name | Description |
|---|---|---|
\WP_Post |
$post |
Post object. |
sanitize_post_meta()
Sanitize Post Meta array.
Line: 282
public function sanitize_post_meta( $settings ): array;
| Type | Name | Description |
|---|---|---|
array |
$settings |
Post meta settings array. |
Returns: array — Sanitized value.