LLMS_Admin_Metabox::save_field( int $post_id, array $field )
Save a metabox field.
Parameters Parameters
- $post_id
-
(int) (Required) WP_Post ID.
- $field
-
(array) (Required) Metabox field array.
Return Return
(boolean)
Source Source
File: includes/abstracts/abstract.llms.admin.metabox.php
if ( ( isset( $_POST['action'] ) && 'inline-save' === $_POST['action'] ) || llms_is_ajax() ) {
return 0;
}
// Get all defined fields.
$fields = $this->get_fields();
if ( ! is_array( $fields ) ) {
return 0;
}
// Loop through the fields.
foreach ( $fields as $group => $data ) {
// Find the fields in each tab.
if ( isset( $data['fields'] ) && is_array( $data['fields'] ) ) {
// Loop through the fields.
foreach ( $data['fields'] as $field ) {
// Don't save things that don't have an ID or that are set to be skipped.
if ( isset( $field['id'] ) && empty( $field['skip_save'] ) ) {
$this->save_field( $post_id, $field );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.9.0 | Stop using deprecated FILTER_SANITIZE_STRING. |
| 3.37.12 | Introduced. |