Skip to main content

Custom Fields — functions

1 public function. 1 are 🔌 pluggable (function_exists()-guarded, so a theme/child can override them).

FunctionSummary
fw_get_fieldRead a custom field value saved by the Custom Fields extension.

fw_get_field

🔌 pluggable

fw_get_field( $name, $post_id = null, $default = null )

Read a custom field value saved by the Custom Fields extension.

Thin wrapper over fw_get_db_post_option(): the field's "name" is the post meta / option id, so this resolves to whatever the field stored (string, array, upload array, etc.).

ParameterTypeDescription
$namestringThe field name (its key).
$post_idint|nullPost id; defaults to the current post in the loop.
$defaultmixedReturned when nothing is stored.

Returns mixed

Source: framework/extensions/custom-fields/helpers.php:19

← Back to Functions overview