Easy Property Listings 3.4.40 Code Reference
  • Package
  • Class
  • Tree
  • Todo
  • Hook Reference

Packages

  • EPL
    • Admin
      • Actions
      • Classes
        • ContactsTable
        • ReportsGraph
        • Welcome
      • Contacts
      • ContactsActions
      • ContactsFunctions
      • Elements
      • Functions
      • Help
      • HelpSingle
      • Menus
      • MenusAddons
      • MenusExtensions
      • MenusLicenses
      • Plugins
      • Reports
      • ReportsGraphing
      • User
    • Assets
      • ScriptsStyles
      • SVG
    • Classes
      • AuthorLoader
      • AuthorMeta
      • Contact
      • Cron
      • CustomPostType
      • Forms
      • License
      • ListingAdvanced
      • ListingElements
      • MetaboxesCustomFields
      • Pagination
      • PropertyMeta
      • RenderFields
      • Search
      • Session
      • Updater
    • Compatibility
      • Extensions
      • Functions
      • Shortcodes
    • Functions
      • Actions
      • ConditionalTags
      • ErrorTracking
      • Formatting
      • Front
      • Global
      • Install
      • Pagination
      • Settings
      • Templates
    • Hooks
      • EnergyCertificate
      • ExternalLinks
      • FloorPlan
      • Map
      • ReadMore
      • WebLink
    • Meta
      • InitCustomFields
      • Meta
    • PostTypes
      • Business
      • Commercial
      • CommercialLand
      • Contact
      • Functions
      • Land
      • Property
      • Rental
      • Rural
    • Shortcode
      • CommercialListingSearch
      • ContactForm
      • Listing
      • ListingAdvanced
      • ListingAuction
      • ListingCategory
      • ListingFeature
      • ListingLocation
      • ListingMetaDoc
      • ListingOpen
      • ListingSearch
      • Map
    • Taxonomy
      • BusinessCategories
      • ContactTag
      • Features
      • Location
    • Templates
      • Themes
        • iThemes
        • iThemesBuilder
    • Widget
      • Admin
        • Dashboard
      • Classes
        • Author
        • ContactCapture
        • Gallery
        • Listing
        • Search
      • Functions
  • None
  • WordPress
    • Session

Classes

  • EPL_CPT

Class EPL_CPT

EPL_CPT Class

Package: EPL\Classes\CustomPostType
Copyright: Copyright (c) 2019, Merv Barrett
License: GNU Public License
Since: 2.3
Located at lib/includes/class-epl-cpt.php

Methods summary

public
# __construct( mixed $post_type_names, array $options = array() )

Constructor

Constructor

Register a custom post type.

Parameters

$post_type_names
The name(s) of the post type, accepts (post type name, slug, plural, singular).
$options
User submitted options.
public mixed
# get( string $var )

Get

Get

Helper function to get an object variable.

Parameters

$var
The variable you would like to retrieve.

Returns

mixed
Returns the value on success, boolean false whe it fails.
public
# set( mixed $var, 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

$var
The variable you would like to create/overwrite.
$value
The value you would like to set to the variable.
public
# add_action( string $action, string $function, integer $priority = 10, integer $accepted_args = 1 )

Add Action

Add Action

Helper function to add add_action WordPress filters.

Parameters

$action
Name of the action.
$function
Function to hook that will run on action.
$priority
Order in which to execute the function, relation to other functions hooked to this action.
$accepted_args
The number of arguments the function accepts.
public
# add_filter( string $action, string $function, integer $priority = 10, integer $accepted_args = 1 )

Add Filter

Add Filter

Create add_filter WordPress filter.

Parameters

$action
Name of the action to hook to, e.g 'init'.
$function
Function to hook that will run on @action.
$priority
Order in which to execute the function, relation to other function hooked to this action.
$accepted_args
The number of arguements the function accepts.

See

http://codex.wordpress.org/Function_Reference/add_filter
public string
# get_slug( string $name = null )

Get slug

Get slug

Creates an url friendly slug.

Parameters

$name
Name to slugify.

Returns

string
$name Returns the slug.
public string
# get_plural( string $name = null )

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

$name
The slug name you want to pluralize.

Returns

string
the friendly pluralized name.
public string
# get_singular( string $name = null )

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

$name
The slug name you want to unpluralize.

Returns

string
The friendly singular name.
public string
# get_human_friendly( string $name = null )

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

$name
The name you want to make friendly.

Returns

string
The human friendly name.
public
# register_post_type( )

Register Post Type

Register Post Type

See

http://codex.wordpress.org/Function_Reference/register_post_type
public
# register_taxonomy( string $taxonomy_names, array $options = array() )

Register taxonomy

Register taxonomy

Parameters

$taxonomy_names
The slug for the taxonomy.
$options
Taxonomy options.

See

http://codex.wordpress.org/Function_Reference/register_taxonomy
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 array
# add_admin_columns( array $columns )

Add admin columns

Add admin columns

Adds columns to the admin edit screen. Function is used with add_action

Parameters

$columns
Columns to be added to the admin edit screen.

Returns

array
public
# populate_admin_columns( string $column, integer $post_id )

Populate admin columns

Populate admin columns

Populate custom columns on the admin edit screen.

Parameters

$column
The name of the column.
$post_id
The post ID.

Since

3.4.33 Fixed the output escaping.
public
# filters( array $filters = array() )

Filters

Filters

User function to define which taxonomy filters to display on the admin page.

Parameters

$filters
An array of taxonomy filters to display.
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

$columns
An array of columns to be displayed.
public
# populate_column( string $column_name, string $function )

Populate columns

Populate columns

Define what and how to populate a speicific admin column.

Parameters

$column_name
The name of the column to populate.
$function
An anonyous function to run when populating the column.
public
# sortable( array $columns = array() )

Sortable

Sortable

Define what columns are sortable in the admin edit screen.

Parameters

$columns
An array of columns that are sortable.
public array
# make_columns_sortable( array $columns )

Make columns sortable

Make columns sortable

Internal function that adds user defined sortable columns to WordPress default columns.

Parameters

$columns
Columns to be sortable.

Returns

array
public
# load_edit( )

Load edit

Load edit

Sort columns only on the edit.php page when requested.

See

http://codex.wordpress.org/Plugin_API/Filter_Reference/request
public array
# sort_columns( array $vars )

Sort columns

Sort columns

Internal function that sorts columns on request.

Parameters

$vars
The query vars submitted by user.

Returns

array
A sorted array.

See

EPL_CPT::load_edit()
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

$icon
dashicon name.
public
# set_textdomain( string $textdomain )

Set textdomain

Set textdomain

Parameters

$textdomain
Textdomain used for translation.

Properties summary

public string $post_type_name

Post type name.

Post type name.

#
public string $singular

Holds the singular name of the post type. This is a human friendly name, capitalized with spaces assigned on __construct().

Holds the singular name of the post type. This is a human friendly name, capitalized with spaces assigned on __construct().

#
public string $plural

Holds the plural name of the post type. This is a human friendly name, capitalized with spaces assigned on __construct().

Holds the plural name of the post type. This is a human friendly name, capitalized with spaces assigned on __construct().

#
public string $slug

Post type slug. This is a robot friendly name, all lowercase and uses hyphens assigned on __construct().

Post type slug. This is a robot friendly name, all lowercase and uses hyphens assigned on __construct().

#
public array $options

User submitted options assigned on __construct().

User submitted options assigned on __construct().

#
public array $taxonomies

Taxonomies

Taxonomies

#
public array $taxonomy_settings

Taxonomy settings, an array of the taxonomies associated with the post type and their options used when registering the taxonomies.

Taxonomy settings, an array of the taxonomies associated with the post type and their options used when registering the taxonomies.

#
public array $exisiting_taxonomies

Exisiting taxonomies to be registered after the post has been registered

Exisiting taxonomies to be registered after the post has been registered

#
public array $filters

Taxonomy filters. Defines which filters are to appear on admin edit screen used in add_taxonmy_filters().

Taxonomy filters. Defines which filters are to appear on admin edit screen used in add_taxonmy_filters().

#
public array $columns

Defines which columns are to appear on the admin edit screen used in add_admin_columns().

Defines which columns are to appear on the admin edit screen used in add_admin_columns().

#
public array $custom_populate_columns

User defined functions to populate admin columns.

User defined functions to populate admin columns.

#
public array $sortable

Sortable columns.

Sortable columns.

#
public string $textdomain

Textdomain used for translation. Use the set_textdomain() method to set a custom textdomain.

Textdomain used for translation. Use the set_textdomain() method to set a custom textdomain.

# 'easy-property-listings'
Easy Property Listings 3.4.40 Code Reference API documentation generated by ApiGen