atpCustom Reference

klaviyo_coupons extends abstract_extension
in package
Uses html_input_fields

Extension: klaviyo_coupons -

Tags
category

WordPress Plugin

author

Kevin Burkholder KBurkholder@EarthAsylum.com

copyright

Copyright (c) 2025 American Telecast Products

uses
abstract_extension

Table of Contents

TAXONOMY_NAME  = 'atp_klaviyo_coupons'
VERSION  = '25.1031.1'
__construct()  : void
constructor method
add_inline_style()  : void
custom styles for term screen.
addActionsAndFilters()  : void
Add filters and actions - called from main plugin.
addShortcodes()  : void
Add offer shortcodes for all taxonomy values.
create_taxonomy_term()  : void
Create new custom term meta (action create_{taxonomy})
delete_taxonomy_term()  : void
Delete custom term meta (action delete_{taxonomy})
edit_taxonomy_term()  : void
Saves custom term meta when data is edited (action edit_{taxonomy})
get_coupon_options()  : string|array<string|int, mixed>
get taxonomy options/meta (filter klaviyo_coupon_options)
get_term_meta()  : array<string|int, mixed>
Get custom term meta array
klaviyo_coupon_shortcode()  : mixed
offer shortcode for all taxonomy values.
register_options()  : void
Register the taxonomy option field meta data
register_taxonomy()  : void
Registers taxonomy.
taxonomy_form_fields()  : void
adds fields to the taxonomy editor page (action {taxonomy}_edit_form_fields)
taxonomy_form_table()  : void
adds fields to the end of the taxonomy editor page (action {taxonomy}_edit_form)
taxonomy_list_actions()  : array<string|int, mixed>
adjust taxonomy list row actions (filter {taxonomy}_row_actions)
taxonomy_list_actions_post()  : void
handle taxonomy list row actions (action admin_init)
taxonomy_list_description()  : void
adds description to our taxonomy page.
taxonomy_list_notes()  : void
adds notes to our taxonomy page.
taxonomy_menu()  : void
Add taxonomy to a menu.
update_term_meta()  : void
Update custom term meta array

Constants

Methods

__construct()

constructor method

public __construct(object $plugin) : void
Parameters
$plugin : object

main plugin object

Return values
void

addActionsAndFilters()

Add filters and actions - called from main plugin.

public addActionsAndFilters() : void

Hook names are prefixed with main plugin name

Return values
void

addShortcodes()

Add offer shortcodes for all taxonomy values.

public addShortcodes() : void

called from offer_manager extension addShortcodes()

Return values
void

create_taxonomy_term()

Create new custom term meta (action create_{taxonomy})

public create_taxonomy_term(mixed $term_id, int $tt_id[, array<string|int, mixed> $args = null ]) : void
Parameters
$term_id : mixed
$tt_id : int

term taxonomy ID

$args : array<string|int, mixed> = null

arguments passed to wp_insert_term().

Return values
void

delete_taxonomy_term()

Delete custom term meta (action delete_{taxonomy})

public delete_taxonomy_term(int $term_id, int $tt_id, string $taxonomy, WP_Term $term[, array<string|int, mixed> $object_ids = null ]) : void
Parameters
$term_id : int

Term ID.

$tt_id : int

Term taxonomy ID.

$taxonomy : string

Taxonomy slug.

$term : WP_Term

Copy of the already-deleted term.

$object_ids : array<string|int, mixed> = null

List of term object IDs.

Return values
void

edit_taxonomy_term()

Saves custom term meta when data is edited (action edit_{taxonomy})

public edit_taxonomy_term(int $term_id, int $tt_id[, array<string|int, mixed> $args = null ]) : void
Parameters
$term_id : int

term id being edited

$tt_id : int

term taxonomy ID

$args : array<string|int, mixed> = null

arguments passed to wp_insert_term().

Return values
void

get_coupon_options()

get taxonomy options/meta (filter klaviyo_coupon_options)

public get_coupon_options(string $default, int|string $term_or_slug[, string $key = null ]) : string|array<string|int, mixed>
Parameters
$default : string

option value default

$term_or_slug : int|string

term id or slug

$key : string = null

get a key from the array

Return values
string|array<string|int, mixed>

get_term_meta()

Get custom term meta array

public get_term_meta(int $term_id[, string $key = null ]) : array<string|int, mixed>
Parameters
$term_id : int

Term ID.

$key : string = null

optional value key.

Return values
array<string|int, mixed>

klaviyo_coupon_shortcode()

offer shortcode for all taxonomy values.

public klaviyo_coupon_shortcode([mixed $atts = null ][, string $content = 'description' ]) : mixed
Parameters
$atts : mixed = null
$content : string = 'description'
Return values
mixed

register_options()

Register the taxonomy option field meta data

public register_options([mixed $term_id = null ]) : void
Parameters
$term_id : mixed = null
Return values
void

taxonomy_form_fields()

adds fields to the taxonomy editor page (action {taxonomy}_edit_form_fields)

public taxonomy_form_fields(int $term) : void
Parameters
$term : int

term being edited

Return values
void

taxonomy_form_table()

adds fields to the end of the taxonomy editor page (action {taxonomy}_edit_form)

public taxonomy_form_table(int $term) : void
Parameters
$term : int

term being edited

Return values
void

taxonomy_list_actions()

adjust taxonomy list row actions (filter {taxonomy}_row_actions)

public taxonomy_list_actions(array<string|int, mixed> $actions, object $term) : array<string|int, mixed>
Parameters
$actions : array<string|int, mixed>

array of actions.

$term : object

term object.

Return values
array<string|int, mixed>

taxonomy_list_actions_post()

handle taxonomy list row actions (action admin_init)

public taxonomy_list_actions_post() : void
Return values
void

taxonomy_list_description()

adds description to our taxonomy page.

public taxonomy_list_description() : void
Return values
void

taxonomy_list_notes()

adds notes to our taxonomy page.

public taxonomy_list_notes() : void
Return values
void

taxonomy_menu()

Add taxonomy to a menu.

public taxonomy_menu() : void

Only when not associated with a post type.

Return values
void

update_term_meta()

Update custom term meta array

public update_term_meta(int $term_id, mixed $values[, string $key = null ]) : void
Parameters
$term_id : int

Term ID.

$values : mixed

array of or single value.

$key : string = null

optional value key.

Return values
void

Search results