Metabox_API
Metabox API class.
Namespace: WebberZone\Contextual_Related_Posts\Admin\Settings
Source: includes/admin/settings/class-metabox-api.php line 18
Methods
__construct()
Main constructor class.
Line: 82
public function __construct( $args );
| Type | Name | Description |
|---|---|---|
array|string | $args | { |
add_meta_boxes()
Function to add the metabox.
Line: 106
public function add_meta_boxes( );
admin_enqueue_scripts()
Enqueue scripts and styles.
Line: 122
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: 139
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: 148
public function save( $post_id );
| Type | Name | Description |
|---|---|---|
int|string | $post_id | Post ID. |
html()
Function to display the metabox.
Line: 234
public function html( $post );
| Type | Name | Description |
|---|---|---|
\WP_Post | $post | Post object. |
sanitize_post_meta()
Sanitize Post Meta array.
Line: 280
public function sanitize_post_meta( $settings ): array;
| Type | Name | Description |
|---|---|---|
array | $settings | Post meta settings array. |
Returns: array — Sanitized value.