PHP Class RCCWP_Post, Magic-Fields

Show file Open project: hunk/Magic-Fields Class Usage Examples

Public Methods

Method Description
DeletePostMetaData ( integer $postId ) This Method is Executed when a post is deleted
GetCustomWritePanel ( ) : Custom Get a custom write panel by reading $_REQUEST['custom-write-panel-id'] or the To see whether $_GET['post'] has a custom write panel associated to it.
PrepareFieldsValues ( $postId ) This function prepares some custom fields before saving it. It reads $_REQUEST and: 1. Adds params to photos uploaded (Image field) 2. Formats dates (Date Field)
SaveCustomFields ( $postId ) This function is called when a post is saves
SetCustomWritePanel ( integer $postId ) Attach a custom write panel to the current post by saving the custom write panel id as a meta value for the post
SetMetaValues ( integer $postId ) : void Save all custom field values meta values for the post, this function assumes that $_POST['rc_cwp_meta_keys'] contains the names of the fields, while $_POST[{FIELD_NAME}] contains the value of the field named {FIELD_NAME}

Method Details

DeletePostMetaData() public method

@param integer $postId
public DeletePostMetaData ( integer $postId )
$postId integer

GetCustomWritePanel() public static method

Get a custom write panel by reading $_REQUEST['custom-write-panel-id'] or the To see whether $_GET['post'] has a custom write panel associated to it.
public static GetCustomWritePanel ( ) : Custom
return Custom Write Panel as an object, returns null if there is no write panels.

PrepareFieldsValues() public method

@param integer postId
public PrepareFieldsValues ( $postId )

SaveCustomFields() public static method

This function is called when a post is saves
public static SaveCustomFields ( $postId )

SetCustomWritePanel() public method

@param integer $postId
public SetCustomWritePanel ( integer $postId )
$postId integer

SetMetaValues() public method

Save all custom field values meta values for the post, this function assumes that $_POST['rc_cwp_meta_keys'] contains the names of the fields, while $_POST[{FIELD_NAME}] contains the value of the field named {FIELD_NAME}
public SetMetaValues ( integer $postId ) : void
$postId integer
return void