EPL_CPT Class
| Since | |
|---|---|
2.3 |
|
| Methods | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(mixed $post_type_names, array $options = [])
Constructor
Constructor Register a custom post type. Parameters
|
# | ||||||||
public
|
get(string $variable): mixed
Get
Get Helper function to get an object variable. Parameters
ReturnsReturns the value on success, boolean false whe it fails. |
# | ||||||||
public
|
set(mixed $variable, mixed $value)
Set
Set Helper function used to set an object variable. Can overwrite existsing variables or create new ones. Cannot overwrite reserved variables. Parameters
|
# | ||||||||
public
|
add_action(string $action, string $callback, int $priority = 10, integer $accepted_args = 1)
Add Action
Add Action Helper function to add add_action WordPress filters. Parameters
|
# | ||||||||
public
|
add_filter(string $action, string $callback, int $priority = 10, int $accepted_args = 1)
Add Filter
Add Filter Create add_filter WordPress filter. Parameters
|
# | ||||||||
public
|
get_slug(string $name = null): string
Get slug
Get slug Creates an url friendly slug. Parameters
Returns$name Returns the slug. |
# | ||||||||
public
|
get_plural(string $name = null): string
Get plural
Get plural Returns the friendly plural name. ucwords capitalize words strtolower makes string lowercase before capitalizing str_replace replace all instances of _ to space Parameters
Returnsthe friendly pluralized name. |
# | ||||||||
public
|
get_singular(string $name = null): string
Get singular
Get singular Returns the friendly singular name. ucwords capitalize words strtolower makes string lowercase before capitalizing str_replace replace all instances of _ to space Parameters
ReturnsThe friendly singular name. |
# | ||||||||
public
|
get_human_friendly(string $name = null): string
Get human friendly
Get human friendly Returns the human friendly name. ucwords capitalize words strtolower makes string lowercase before capitalizing str_replace replace all instances of hyphens and underscores to spaces Parameters
ReturnsThe human friendly name. |
# | ||||||||
public
|
register_post_type()
Register Post Type
Register Post Type Since
|
# | ||||||||
public
|
register_taxonomy(string $taxonomy_names, array $options = [])
Register taxonomy
Register taxonomy Parameters
|
# | ||||||||
public
|
register_taxonomies()
Register taxonomies
Register taxonomies Cycles through taxonomies added with the class and registers them. |
# | ||||||||
public
|
register_exisiting_taxonomies()
Register Exisiting Taxonomies
Register Exisiting Taxonomies Cycles through exisiting taxonomies and registers them after the post type has been registered |
# | ||||||||
public
|
add_admin_columns(array $columns): array
Add admin columns
Add admin columns Adds columns to the admin edit screen. Function is used with add_action Parameters
|
# | ||||||||
public
|
populate_admin_columns(string $column, integer $post_id)
Populate admin columns
Populate admin columns Populate custom columns on the admin edit screen. Parameters
Since
|
# | ||||||||
public
|
filters(array $filters = [])
Filters
Filters User function to define which taxonomy filters to display on the admin page. Parameters
|
# | ||||||||
public
|
add_taxonomy_filters()
Add taxtonomy filters
Add taxtonomy filters Creates select fields for filtering posts by taxonomies on admin edit screen. |
# | ||||||||
public
|
columns(array $columns)
Columns
Columns Choose columns to be displayed on the admin edit screen. Parameters
|
# | ||||||||
public
|
populate_column(string $column_name, string $callback)
Populate columns
Populate columns Define what and how to populate a speicific admin column. Parameters
|
# | ||||||||
public
|
sortable(array $columns = [])
Sortable
Sortable Define what columns are sortable in the admin edit screen. Parameters
|
# | ||||||||
public
|
make_columns_sortable(array $columns): array
Make columns sortable
Make columns sortable Internal function that adds user defined sortable columns to WordPress default columns. Parameters
|
# | ||||||||
public
|
load_edit()
Load edit
Load edit Sort columns only on the edit.php page when requested. |
# | ||||||||
public
|
sort_columns(array $vars): array
Sort columns
Sort columns Internal function that sorts columns on request. Parameters
ReturnsA sorted array. |
# | ||||||||
public
|
menu_icon(string $icon = 'dashicons-admin-page')
Set menu icon
Set menu icon Use this function to set the menu icon in the admin dashboard. Since WordPress v3.8 dashicons are used. For more information see @link http://melchoyce.github.io/dashicons/ Parameters
|
# | ||||||||
public
|
set_textdomain(string $textdomain)
Set textdomain
Set textdomain Parameters
|
# | ||||||||
| Properties | |||
|---|---|---|---|
public
|
string
|
$post_type_name
Holds the name of the post type.
Holds the name of the post type. |
# |
public
|
string
|
$singular
Post type singular name.
Post type singular name. |
# |
public
|
string
|
$plural
Singular post type name.
Singular post type name. |
# |
public
|
string
|
$slug
Holds the post type slug name.
Holds the post type slug name. |
# |
public
|
array
|
$options
Holds the user submitted post type options.
Holds the user submitted post type options. |
# |
public
|
array
|
$taxonomies
Holds an array of taxonomies associated with the post type.
Holds an array of taxonomies associated with the post type. |
# |
public
|
array
|
$taxonomy_settings
Holds the taxonomy settings.
Holds the taxonomy settings. |
# |
public
|
array
|
$exisiting_taxonomies
holds exisiting taxonomies
holds exisiting taxonomies |
# |
public
|
array
|
$filters
Taxonomy filters.
Taxonomy filters. |
# |
public
|
array
|
$columns
Columns visible in admin edit screen.
Columns visible in admin edit screen. |
# |
public
|
array
|
$custom_populate_columns
User functions to populate columns.
User functions to populate columns. |
# |
public
|
array
|
$sortable
Define which columns are sortable on the admin edit screen.
Define which columns are sortable on the admin edit screen. |
# |
public
|
string
|
$textdomain = 'easy-property-listings'
Used for internationalising. Defaults to "cpt" without quotes.
Used for internationalising. Defaults to "cpt" without quotes. |
# |