Term_Image extends React_Term
Adds an image picker to categories and attributes.
Table of Contents
- $file_name : string
- Name of the file that will be enqueued.
- $json_accessor : string
- The name of the constant that holds the json data for the frontend.
- $plugin : Licensed_Plugin
- Plugin instance.
- __construct() : mixed
- Get things started.
- assets() : void
- Enqueue the media library assets.
- created_term() : void
- Save the filter image attachment ID when creating or updating a category.
- output() : void
- Renders the picker dom element.
- output_edit() : void
- Renders the picker dom element.
- register() : void
- Hook into WP.
- register_into_attribute_forms() : void
- Find WC attributes and display out custom field for the picker.
- should_enqueue() : bool
- Determine if the react assets should enqueue.
- is_edit_page() : bool
- Determine if we're viewing the edit page of a term.
Properties
$file_name
Name of the file that will be enqueued.
public
string
$file_name
= 'wcf-term-image'
Name only, without the extension.
$json_accessor
The name of the constant that holds the json data for the frontend.
public
string
$json_accessor
$plugin
Plugin instance.
public
Licensed_Plugin
$plugin
Methods
__construct()
Get things started.
public
__construct(Licensed_Plugin $plugin) : mixed
Parameters
- $plugin : Licensed_Plugin
Return values
mixed —assets()
Enqueue the media library assets.
public
assets() : void
Return values
void —created_term()
Save the filter image attachment ID when creating or updating a category.
public
created_term(string $term_id, string $tt_id, string $taxonomy) : void
Parameters
- $term_id : string
- $tt_id : string
- $taxonomy : string
Return values
void —output()
Renders the picker dom element.
public
output() : void
Return values
void —output_edit()
Renders the picker dom element.
public
output_edit(WP_Term $term, string $taxonomy) : void
Parameters
- $term : WP_Term
- $taxonomy : string
Return values
void —register()
Hook into WP.
public
register() : void
Return values
void —register_into_attribute_forms()
Find WC attributes and display out custom field for the picker.
public
register_into_attribute_forms() : void
Return values
void —should_enqueue()
Determine if the react assets should enqueue.
public
should_enqueue() : bool
Return values
bool —is_edit_page()
Determine if we're viewing the edit page of a term.
protected
is_edit_page() : bool