PHP 클래스 RCCWP_CustomWritePanel, Magic-Fields

파일 보기 프로젝트 열기: hunk/Magic-Fields 1 사용 예제들

공개 메소드들

메소드 설명
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'