registry = $registry; $this->object = $object; } /** * Get the set value for a particular field. * * @since 1.6.0 * * @param string $field_key The field to get a value for. * @return mixed */ public function get( $field_key ) { $field = $this->registry->get_field( $field_key ); if ( ! $field ) { return null; } return call_user_func( $field->value_callback, $this->object, $field_key ); } /** * Check whether a particular field is registered. * * @since 1.6.0 * * @param string $field_key The field to check for. * @return boolean */ public function has( $field_key ) { return false !== $this->registry->get_field( $field_key ); } /** * Check whether a particular field has a callback for getting the value. * * @since 1.6.0 * * @param string $field_key The field to check for. * @return boolean */ public function has_value_callback( $field_key ) { $field = $this->registry->get_field( $field_key ); return $field && false !== $field->value_callback; } } endif;