Class: RCCWP_CustomField

Source Location: /RCCWP_CustomField.php

Class Overview [line 12]


Create/Edit/Delete custom fields

Author(s):

Version:

Copyright:

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods



Class Details

Create/Edit/Delete custom fields

[ Top ]


Class Variables


Class Methods

Create

the Create( id $customGroupId, string $name, string $label, [integer $order = 1], [integer $required_field = 0], integer $type, [array $options = null], [array $default_value = null], [array $properties = null], $duplicate)

[line 35]

Create a new custom field

Tags:

  • return - new field id

Parameters:

  • id $customGroupId - the id of the group that will contain the field
  • string $name - the name of the field, the name is used to uniquely identify the field when retrieving its value.
  • string $label - the label of the field, the label is displayed beside the field in Write tab.
  • integer $order - the order of the field when it is displayed in the Write tab.
  • integer $required_field - whether this field is a required field. Required fields doesn't allow users to save a post if they are null.
  • integer $type - the type of the field. Use $FIELD_TYPES defined in RCCWP_Constant.php
  • array $options - array of strings that represent the list of the field if its type is list.
  • array $default_value - array of strings that represent default value(s) of of the field if its type is list.
  • array $properties - an array containing extra properties of the field.
  • $duplicate -

[ Top ]

Delete

void Delete( [integer $customFieldId = null])

[line 107]

Delete a field

Parameters:

  • integer $customFieldId - field id

[ Top ]

Get

an Get( integer $customFieldId)

[line 138]

Get the field information including properties, options and default value(s)

Tags:

  • return - object containing information about fields. The object contains 3 objects: properties, options and default_value

Parameters:

  • integer $customFieldId - field id

[ Top ]

GetCustomFieldTypes

a GetCustomFieldTypes( [integer $customFieldTypeId = null])

[line 162]

Retrievies information about a specified type

Tags:

  • return - list/object containing information about the specified type. The information includes id, name, description, has_options, has_properties, and allow_multiple_values (whether fields of that type can have more than one default value)

Parameters:

  • integer $customFieldTypeId - the type id, if null, a list of all types will be returned

[ Top ]

GetCustomFieldValues

a GetCustomFieldValues( boolean $single, integer $postId, string $customFieldName, [integer $groupIndex = 1], [integer $fieldIndex = 1])

[line 214]

Retrieves the value of a custom field for a specified post

Parameters:

  • boolean $single -
  • integer $postId -
  • string $customFieldName -
  • integer $groupIndex -
  • integer $fieldIndex -

[ Top ]

GetFieldDuplicates

number GetFieldDuplicates( integer $postId, $fieldName, $groupIndex, integer $fieldID)

[line 262]

Get number of group duplicates given field name. The function returns 1 if there are no duplicates (just he original group), 2 if there is one duplicate and so on.

Tags:

  • return - of groups

Parameters:

  • integer $postId - post id
  • integer $fieldID - the name of any field in the group
  • $fieldName -
  • $groupIndex -

[ Top ]

GetFieldGroupDuplicates

number GetFieldGroupDuplicates( integer $postId, $fieldName, integer $fieldID)

[line 246]

Get number of group duplicates given field name. The function returns 1 if there are no duplicates (just he original group), 2 if there is one duplicate and so on.

Tags:

  • return - of groups

Parameters:

  • integer $postId - post id
  • integer $fieldID - the name of any field in the group
  • $fieldName -

[ Top ]

GetIDByName

custom GetIDByName( string $customFieldName)

[line 275]

Retrieves the id of a custom field given field name for the current post.

Tags:

  • return - field id

Parameters:

  • string $customFieldName -

[ Top ]

Update

void Update( integer $customFieldId, string $name, string $label, [integer $order = 1], [integer $required_field = 0], integer $type, [array $options = null], [array $default_value = null], [array $properties = null], $duplicate)

[line 320]

Updates the properties of a custom field.

Parameters:

  • integer $customFieldId - the id of the field to be updated
  • string $name - the name of the field, the name is used to uniquely identify the field when retrieving its value.
  • string $label - the label of the field, the label is displayed beside the field in Write tab.
  • integer $order - the order of the field when it is displayed in the Write tab.
  • integer $required_field - whether this field is a required field. Required fields doesn't allow users to save a post if they are null.
  • integer $type - the type of the field. Use $FIELD_TYPES defined in RCCWP_Constant.php
  • array $options - array of strings that represent the list of the field if its type is list.
  • array $default_value - array of strings that represent default value(s) of of the field if its type is list.
  • array $properties - an array containing extra properties of the field.
  • $duplicate -

[ Top ]


Class Constants


Documentation generated on Tue, 09 Sep 2008 12:47:59 +0000 by phpDocumentor 1.4.2