PHP Class WPAS_CF_Taxonomy

Inheritance: extends WPAS_Custom_Field
Show file Open project: awesome-support/awesome-support

Protected Properties

Property Type Description
$ordered_terms The taxonomy terms ordered hierarchically.
$terms The taxonomy terms.

Public Methods

Method Description
__construct ( $field_id, $field )
add_select2_class ( array $classes, array $field ) : array Add the select2 class to the input
display ( ) : string Return the field markup for the front-end.
display_admin ( ) Return the field markup for the admin.
display_no_edit ( ) Return the field markup for the admin.
update ( integer $value, integer $post_id ) : integer Save function.

Method Details

__construct() public method

public __construct ( $field_id, $field )

add_select2_class() public method

Add the select2 class to the input
Since: 3.3
public add_select2_class ( array $classes, array $field ) : array
$classes array Input classes
$field array Array of params of the field being processed
return array

display() public method

Return the field markup for the front-end.
public display ( ) : string
return string Field markup

display_admin() public method

This method is only used if the current user has the capability to edit the field.
public display_admin ( )

display_no_edit() public method

This method is only used if the current user doesn't have the capability to edit the field.
public display_no_edit ( )

update() public method

Taxonomies are saved differently as they are not stored as post metas but actual taxonomy terms.
Since: 3.2.0
public update ( integer $value, integer $post_id ) : integer
$value integer New value
$post_id integer ID of the post being saved
return integer Result of the update

Property Details

$ordered_terms protected property

The taxonomy terms ordered hierarchically.
Since: 3.2.0
protected $ordered_terms

$terms protected property

The taxonomy terms.
Since: 3.2.0
protected $terms