PHP Класс RCCWP_CustomWritePanel, Magic-Fields

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

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

Метод Описание
AssignToRole ( integer $customWritePanelId, string $roleName ) Assign a specified write panel to a role.
Create ( string $name, string $description = '', array $standardFields = [], array $categories = [], integer $display_order = 1, string $type = FALSE, boolean $createDefaultGroup = true, $single_post, $default_theme_page = NULL, $default_parent_page = NULL, $expanded ) : the Create a new write panel.
Delete ( integer $customWritePanelId = null ) Delete a write panel without deleting its modules
Export ( integer $panelID ) Export a write panel to file
Get ( unknown_type $customWritePanelId ) : an Get the properties of a write panel
GetAssignedCategories ( integer $customWritePanelId ) : array Get a list of categories assigned to a write panel
GetAssignedCategoryIds ( integer $customWritePanelId ) : array Get a list of the ids of the categories assigned to a write panel
GetCapabilityName ( string $customWritePanelName ) : string Create a capability name for a write panel given its name. This function is copied from WP's sanitize_title_with_dashes($title) (formatting.php)
GetCountPostNotWritePanel ( $type )
GetCountPstWritePanel ( $write_panel_id )
GetCustomGroups ( $customWritePanelId, $orderby = "name" ) : array Retrieves the groups of a module
GetCustomWritePanels ( $include_global = FALSE ) : array Get all Write Panels.
GetIdByName ( string $name ) : the Gets a write panel id based on write panel name.
GetParentPage ( $customWritePanelName ) : an Get the properties of a write panel
GetStandardFields ( integer $customWritePanelId ) : array Get a list of the standard fields of a the write panel
GetThemePage ( $customWritePanelName ) : an Get the properties of a write panel
GetWritePanelName ( integer $post_id ) : string Return the name of the write panel giving the post_id
Import ( string $panelFilePath, string $writePanelName = false, boolean $overwrite = false ) : the Import a write panel given the file path.
Update ( integer $customWritePanelId, string $name, string $description = '', array $standardFields = [], array $categories = [], integer $display_order = 1, string $type = FALSE, $createDefaultGroup = true, $single_post, $default_theme_page = NULL, $default_parent_page = NULL, $expanded ) Updates the properties of a write panel

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

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

Assign a specified write panel to a role.
public static AssignToRole ( integer $customWritePanelId, string $roleName )
$customWritePanelId integer panel id
$roleName string role name (see roles in wordpress)

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

Create a new write panel.
public Create ( string $name, string $description = '', array $standardFields = [], array $categories = [], integer $display_order = 1, string $type = FALSE, boolean $createDefaultGroup = true, $single_post, $default_theme_page = NULL, $default_parent_page = NULL, $expanded ) : the
$name string write panel name
$description string write panel description
$standardFields array a list of standard fields ids that are to be displayed in in the panel. Use $STANDARD_FIELDS defined in MF_Constant.php
$categories array array of category ids that are checked by default when the user opens Write tab for that panel.
$display_order integer the order of the panel in Magic Fields > Write Panels tab
$type string 'post' or 'page'
$createDefaultGroup boolean indicates whether to create a default group.
Результат the id of the write panel

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

Delete a write panel without deleting its modules
public Delete ( integer $customWritePanelId = null )
$customWritePanelId integer write panel id

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

Export a write panel to file
public Export ( integer $panelID )
$panelID integer

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

Get the properties of a write panel
public static Get ( unknown_type $customWritePanelId ) : an
$customWritePanelId unknown_type
Результат an object containing the properties of the write panel which are id, name, description, display_order, capability_name, type

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

Get a list of categories assigned to a write panel
public static GetAssignedCategories ( integer $customWritePanelId ) : array
$customWritePanelId integer write panel id
Результат array of objects, each object contains cat_id and cat_name

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

Get a list of the ids of the categories assigned to a write panel
public static GetAssignedCategoryIds ( integer $customWritePanelId ) : array
$customWritePanelId integer write panel id
Результат array of ids

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

Create a capability name for a write panel given its name. This function is copied from WP's sanitize_title_with_dashes($title) (formatting.php)
public static GetCapabilityName ( string $customWritePanelName ) : string
$customWritePanelName string panel name
Результат string capability name

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

public static GetCountPostNotWritePanel ( $type )

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

public static GetCountPstWritePanel ( $write_panel_id )

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

Retrieves the groups of a module
public static GetCustomGroups ( $customWritePanelId, $orderby = "name" ) : array
Результат array of objects representing basic information of the group, each object contains id, name and module_id

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

Get all Write Panels.
public static GetCustomWritePanels ( $include_global = FALSE ) : array
Результат array of objects containing all write panels. Each object contains id, name, description, display_order, capability_name, type, always_show

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

Gets a write panel id based on write panel name.
public GetIdByName ( string $name ) : the
$name string
Результат the write panel id

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

Get the properties of a write panel
public static GetParentPage ( $customWritePanelName ) : an
Результат an object containing the properties of the write panel which are id, name, description, display_order, capability_name, type

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

Get a list of the standard fields of a the write panel
public static GetStandardFields ( integer $customWritePanelId ) : array
$customWritePanelId integer panel id
Результат array of ids of the standard fields (see $STANDARD_FIELDS defined in MF_Constant.php)

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

Get the properties of a write panel
public GetThemePage ( $customWritePanelName ) : an
Результат an object containing the properties of the write panel which are id, name, description, display_order, capability_name, type

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

Return the name of the write panel giving the post_id
public GetWritePanelName ( integer $post_id ) : string
$post_id integer
Результат string

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

Import a write panel given the file path.
public Import ( string $panelFilePath, string $writePanelName = false, boolean $overwrite = false ) : the
$panelFilePath string the full path of the panel file
$writePanelName string the write panel name, if this value if false, the function will use the pnl filename as the write panel name. The default value is false
$overwrite boolean whether to overwrite existing panels with the same name
Результат the panel id, or false in case of error.

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

Updates the properties of a write panel
public static Update ( integer $customWritePanelId, string $name, string $description = '', array $standardFields = [], array $categories = [], integer $display_order = 1, string $type = FALSE, $createDefaultGroup = true, $single_post, $default_theme_page = NULL, $default_parent_page = NULL, $expanded )
$customWritePanelId integer panel id
$name string write panel name
$description string write panel description
$standardFields array a list of standard fields ids that are to be displayed in in the panel. Use $STANDARD_FIELDS defined in MF_Constant.php
$categories array array of category ids that are checked by default when the user opens Write tab for that panel.
$display_order integer the order of the panel in Magic Fields > Write Panels tab
$type string 'post' or 'page'