-
A default implementation of PHP’s magic method __toString to allow the MEOW_Field to auto-convert itself to a string when echoed.
-
Apply’s PHPs addslashes function to the field value.
-
Applies WordPress’ balance_tags function to the field value, to correctly balance HTML tags.
-
Forwards a call for a type delegate object onto the object returned by get_delegate in this class.
-
A default implementation for a change method for all field types, designed to be called when any field updates are made.
-
A default implementation to return content for this field that is appropriate for the display of the field in a column in Post and Term management screens in WordPress.
-
Check if the value in this field equals the supplied value.
-
Applies WordPress’ esc_attr function to the field value, for formatting strings to be safely used inside HTML tag attributes.
-
Applies WordPress’ esc_html function to the field value, for escaping HTML blocks. .
-
Applies WordPress’ esc_js function to the field value, to safely escape the value of the string for use in javascript string variables.
-
Applies WordPress’ esc_sql function to safely and securely escape the field of the value for use in SQL statements.
-
Applies WordPress’ like_escape function to the value of the field, to allow safe use in SQL like statements.
-
Applies WordPress’ esc_url function to the field value, to sanitize URLs.
-
Applies WordPress’ esc_url_raw function to the field value, which is the same as esc_url but does not replace HTML entities in the string.
-
Returns the value of the field cast to a float if it is numeric, or the value of the $fallback argument otherwise (which defaults to 0.00).
-
A default implementation of the forward method which simply returns a WOOF_Silent object to indicate that the field type does not support call forwarding to another delegate object. When implemented by specific field types, this method enables the ability to directly forward method calls from the MEOW_Field object to another object that the field type is delegating to – for example, the Related Post field type delegates to a WOOF_Post object representing the first post selected in the field UI.This method is intended for internal use, and should not be called directly.
-
A default implementation of the html method for field types, which simply forwards the call to MPFT::val.
-
Returns the value of the field cast to an integer if it is numeric, or the value of the $fallback argument otherwise (which defaults to 0).
-
A default implementation of the is method for field types, which simply returns the value of the field.
-
Checks if the field value is a valid email address, via WordPress’ is_email function.
-
Checks if the value of the field is numeric, via PHP’s is_numeric function.
-
kses( Array $allowed_html = null, Array $allowed_protocols = null )String
Applies WordPress wp_kses function to the value of the field to safely sanitize its content.
-
Applies PHP’s md5 function to the value of the field.
-
Applies the WOOF::nl2 method to the value of the field. .
-
Applies PHP’s nl2br function to the field value.
-
Applies the WOOF::nl2p function to the field value.
-
Retrieves the raw value of the field (after decoding the value in the database, as some values are encoded to json).
-
A shorthand synonym for the MPFT::sanitize function.
-
Calls the sanitize_title_with_dashes WordPress function on the field value, with some optional post-processing.
-
Calls WordPress’ sanitize_email function on the field value.
-
Generates a short hash (via truncated md5) of the field value, configurable via a length parameter. .
-
Applies the MPFT::__toString on the field to return the string representation of the field.
-
Calls PHP’s stripslashes function on the field value. .
-
t( String $tmpl, $default = null )String
Outputs the value of this field in a supplied template with a placeholder for where the field value should be, but only if the value is not empty.
-
An alternative syntax to MPFT::truncate_custom with explicit arguments, which also always truncates at the end.
-
Calls the WOOF::truncate method on the field value, which chops the value to the specified length, with various options to control where and if the truncation takes place.
-
An alternative syntax to MPFT::truncate_custom with explicit arguments, which always truncates in the middle.
-
A shorthand to return the field’s value.
-
Returns the value of the field, which is very useful in expressions involving the field, or for placing the value in a variable.
-
A default implementation that field types use when being assigned a value, to parse that value into the correct format for data storage assigned value when assigning values to fields directly, which allows field types to offer a very developer-friendly interface for assignment.Note that this default implementation simply returns the value as it was assigned, which is appropriate for most simple fields.The Related Term field type, for example, overrides this method to allow terms to be set via arrays or CSV string of term slugs, term names, or term IDs.
-
Wraps the string value of the field in the specified tag if the field has a value, but falls back to the default value otherwise. This method can be helpful to allow you to output a field value in a single line of code without needing to check for its presence first, especially when using a null default paramater, which will not even output.