Method | Description | |
---|---|---|
Create ( id $customGroupId, string $name, string $label, integer $order = 1, integer $required_field, integer $type, array $options = null, array $default_value = null, array $properties = null, $duplicate, $helptext = null, $css = null ) : the | Create a new custom field | |
Delete ( integer $customFieldId = null ) | Delete a field | |
Get ( integer $customFieldId ) : an | Get the field information including properties, options and default value(s) | |
GetCustomFieldTypes ( integer $customFieldTypeId = null ) : a | Retrieves information about a specified type | |
GetCustomFieldValues ( boolean $single, integer $postId, string $customFieldName, integer $groupIndex = 1, integer $fieldIndex = 1 ) : mixed | Retrieves the value of a custom field for a specified post | |
GetDataField ( string $customFieldName, integer $groupIndex = 1, integer $fieldIndex = 1, integer $postId ) | Get Data Field | |
GetFieldDuplicates ( integer $postId, $fieldName, $groupIndex ) : number | 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. | |
GetFieldGroupDuplicates ( integer $postId, $fieldName ) : number | Get number of group duplicates given field name. The function returns 1 if there are no duplicates (just the original group), 2 if there is one duplicate and so on. | |
GetFieldsOrder ( $postId, $fieldName, $groupId ) : array | Get field duplicates | |
GetInfoByName ( string $customFieldName, $post_id ) : array | Retrieves the id and type of a custom field given field name for the current post. | |
GetMetaID ( integer $postId, $customFieldName, integer $groupIndex = 1, integer $fieldIndex = 1 ) : integer | Get the Meta ID from a custom field with this id is possible get the value of the custom field from the Post Meta table of wordpress | |
GetOrderDuplicates ( integer $postId, $fieldName ) : order | Get the order of group duplicates given the field name. The function returns a array with the orden | |
Update ( integer $customFieldId, string $name, string $label, integer $order = 1, integer $required_field, integer $type, array $options = null, array $default_value = null, array $properties = null, $duplicate, $helptext = null ) | Updates the properties of a custom field. |
public static Create ( id $customGroupId, string $name, string $label, integer $order = 1, integer $required_field, integer $type, array $options = null, array $default_value = null, array $properties = null, $duplicate, $helptext = null, $css = null ) : the | ||
$customGroupId | id | the id of the group that will contain the field |
$name | string | the name of the field, the name is used to uniquely identify the field when retrieving its value. |
$label | string | the label of the field, the label is displayed beside the field in Write tab. |
$order | integer | the order of the field when it is displayed in the Write tab. |
$required_field | integer | whether this field is a required field. Required fields doesn't allow users to save a post if they are null. |
$type | integer | the type of the field. Use $FIELD_TYPES defined in MF_Constant.php |
$options | array | array of strings that represent the list of the field if its type is list. |
$default_value | array | array of strings that represent default value(s) of of the field if its type is list. |
$properties | array | an array containing extra properties of the field. |
return | the | new field id |
public static GetCustomFieldTypes ( integer $customFieldTypeId = null ) : a | ||
$customFieldTypeId | integer | the type id, if null, a list of all types will be returned |
return | a | 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) |
public static GetFieldDuplicates ( integer $postId, $fieldName, $groupIndex ) : number | ||
$postId | integer | post id |
return | number | of groups |
public static GetFieldGroupDuplicates ( integer $postId, $fieldName ) : number | ||
$postId | integer | post id |
return | number | of groups |
public static GetFieldsOrder ( $postId, $fieldName, $groupId ) : array | ||
$fieldName | the name of the field @param $groupId the groupId @return array return the order of the field sorted | |
return | array |
public static GetInfoByName ( string $customFieldName, $post_id ) : array | ||
$customFieldName | string | |
return | array | with custom field id and custom field type |
public static GetOrderDuplicates ( integer $postId, $fieldName ) : order | ||
$postId | integer | post id |
return | order | of one group |
public static Update ( integer $customFieldId, string $name, string $label, integer $order = 1, integer $required_field, integer $type, array $options = null, array $default_value = null, array $properties = null, $duplicate, $helptext = null ) | ||
$customFieldId | integer | the id of the field to be updated |
$name | string | the name of the field, the name is used to uniquely identify the field when retrieving its value. |
$label | string | the label of the field, the label is displayed beside the field in Write tab. |
$order | integer | the order of the field when it is displayed in the Write tab. |
$required_field | integer | whether this field is a required field. Required fields doesn't allow users to save a post if they are null. |
$type | integer | the type of the field. Use $FIELD_TYPES defined in MF_Constant.php |
$options | array | array of strings that represent the list of the field if its type is list. |
$default_value | array | array of strings that represent default value(s) of of the field if its type is list. |
$properties | array | an array containing extra properties of the field. |