-
Notifications
You must be signed in to change notification settings - Fork 0
Filter hooks
Aleksandar Predic edited this page Jul 24, 2020
·
1 revision
/**
* @hook psmfields_metabox_fields_{metabox_id}
* @param array $registeredFields All registered field for the current class instance
*/
return apply_filters(
sprintf('psmfields_metabox_fields_%s', $this->id),
$this->facadeInstance->getFieldsArray()
);
/**
* @hook psmfields_model_save_field_{meta_key}
* @param mixed $value Value passed to the model
* @param int $postId Post object id
*/
$value = apply_filters(
sprintf(
'psmfields_model_save_field_%s',
$metaKey
),
$value,
$postId
);
/**
* @hook psmfields_model_get_field_{meta_key}
* @param string $metaKey Registered field name that is actually meta_key in the post_meta table
* @param int $postId Post object id
*/
return apply_filters(
sprintf(
'psmfields_model_get_field_%s',
$metaKey
),
get_post_meta($postId, $metaKey, true),
$postId
);