PHP Класс RCCWP_Post, Magic-Fields

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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}

Описание методов

DeletePostMetaData() публичный Метод

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

GetCustomWritePanel() публичный статический Метод

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
Результат Custom Write Panel as an object, returns null if there is no write panels.

PrepareFieldsValues() публичный Метод

@param integer postId
public PrepareFieldsValues ( $postId )

SaveCustomFields() публичный статический Метод

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

SetCustomWritePanel() публичный Метод

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

SetMetaValues() публичный Метод

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
Результат void