MEOW_FieldSet

Represents a single field set item within a multiple-item field set. 

Note: technically, for convenience, a single item field set is not modelled as a MEOW_FieldSet, but rather a MEOW_FieldSetCollection. While this is slightly counterintuitive, it behaves the same way for all intents and purposes, as all access to fields underneath will always be on the first item in the collection (see example).

Example: Obtaining a MEOW_FieldSet

List of Methods

Magic Methods

  • __call()

    An implementation of PHP 5’s __call magic method, which in this case simply silences the call by returning a WOOF_Silent instance.Note: this method is not intended to be called directly.

  • __get( String $name )MEOW_Field

    An implementation of PHP 5’s __get magic method, which in this case simply tries to access a field with the name provided via the field method.

  • __set( String $name )

    An implementation of PHP 5’s __set magic method, to allow unknown properties to be set directly.

  • offsetExists()Boolean

    An implementation of the offsetExists method in PHP’s ArrayAccess interface.

Properties

  • fields()WOOF_Collection of MEOW_Field

    Returns a collection of all of the fields in this set.

  • info()MPM_FieldSet

    Returns a model object containing information about the definition of this field set.

  • is( String $name )Boolean

    Returns true if the field by the given name returns true for its “is” method.

  • remove()

    Remove this field from the field set collection that surrounds it.

Custom Fields

  • f( String $name )MEOW_Field

    A synonym for the field method, to retrieve the field with the given name from this field set.

Manipulation

  • __set( String $name )

    An implementation of PHP 5’s __set magic method, to allow unknown properties to be set directly.

  • update()

    Updates the database with with any changes made by any methods that can update the field set.

Theming

  • blank()Boolean

    Returns true if all fields in the field set are currently blank, as determined by calling the MEOW_Field::blank method.

  • exists()Boolean

    Checks if this field is actually defined against the WordPress object it was retrieved for.

  • field( $name )MEOW_Field

    Retrieves the field with the given name from this field set.

  • has()MEOW_Field OR Boolean

    Checks to see if this field set has a field by the given name, but also if that field has a value available, returning the field itself if it is available, or boolean false otherwise.

  • index()Integer

    Returns the index of this field set in the surrounding field set collection.

Utility

  • is_editable()Boolean

    Checks whether or not this field set is editable for the current user, based on the current user’s capabilities.

PHP Interface Method

  • offsetGet( String $name )Mixed

    An implementation of the offsetGet method of PHP’s ArrayAccess interface.

Internal Use

  • __call()

    An implementation of PHP 5’s __call magic method, which in this case simply silences the call by returning a WOOF_Silent instance.Note: this method is not intended to be called directly.

  • __set( String $name )

    An implementation of PHP 5’s __set magic method, to allow unknown properties to be set directly.

  • count()Integer

    Returns 0 if the field set is blank, but 1 otherwise. .

  • field_set_collection()MEOW_FieldSetCollection

    Retrieves the field set collection object that encloses this field.

  • is_editable()Boolean

    Checks whether or not this field set is editable for the current user, based on the current user’s capabilities.

  • mark_dirty()

    An internal method to mark this field as dirty (modified).

  • offsetExists()Boolean

    An implementation of the offsetExists method in PHP’s ArrayAccess interface.

  • offsetGet( String $name )Mixed

    An implementation of the offsetGet method of PHP’s ArrayAccess interface.

  • __call()

    An implementation of PHP 5’s __call magic method, which in this case simply silences the call by returning a WOOF_Silent instance.Note: this method is not intended to be called directly.

  • __get( String $name )MEOW_Field

    An implementation of PHP 5’s __get magic method, which in this case simply tries to access a field with the name provided via the field method.

  • __set( String $name )

    An implementation of PHP 5’s __set magic method, to allow unknown properties to be set directly.

  • blank()Boolean

    Returns true if all fields in the field set are currently blank, as determined by calling the MEOW_Field::blank method.

  • count()Integer

    Returns 0 if the field set is blank, but 1 otherwise. .

  • exists()Boolean

    Checks if this field is actually defined against the WordPress object it was retrieved for.

  • f( String $name )MEOW_Field

    A synonym for the field method, to retrieve the field with the given name from this field set.

  • field( $name )MEOW_Field

    Retrieves the field with the given name from this field set.

  • field_set_collection()MEOW_FieldSetCollection

    Retrieves the field set collection object that encloses this field.

  • fields()WOOF_Collection of MEOW_Field

    Returns a collection of all of the fields in this set.

  • has()MEOW_Field OR Boolean

    Checks to see if this field set has a field by the given name, but also if that field has a value available, returning the field itself if it is available, or boolean false otherwise.

  • index()Integer

    Returns the index of this field set in the surrounding field set collection.

  • info()MPM_FieldSet

    Returns a model object containing information about the definition of this field set.

  • is( String $name )Boolean

    Returns true if the field by the given name returns true for its “is” method.

  • is_editable()Boolean

    Checks whether or not this field set is editable for the current user, based on the current user’s capabilities.

  • mark_dirty()

    An internal method to mark this field as dirty (modified).

  • offsetExists()Boolean

    An implementation of the offsetExists method in PHP’s ArrayAccess interface.

  • offsetGet( String $name )Mixed

    An implementation of the offsetGet method of PHP’s ArrayAccess interface.

  • remove()

    Remove this field from the field set collection that surrounds it.

  • update()

    Updates the database with with any changes made by any methods that can update the field set.

Base Class Methods

View method list from the base class WOOF_Collection.

Latest From the Blog

MasterPress 1.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM