offer_manager_extension
extends abstract_extension
in package
Uses
offer_manager_taxonomy
Extension: offer_manager_extension - marketing offer management - ATP Custom Plugin for WordPress
Tags
Table of Contents
- VERSION = '24.0712.1'
- $offer_taxonomy_link : mixed
- $offer_taxonomy_slug : string
- __construct() : void
- constructor method
- add_backend_style() : void
- custom styles for offer term screen.
- add_frontend_style() : void
- custom styles for offer term screen.
- add_settings_menu() : void
- Puts the taxonomy page in the menus - on 'admin_menu' action
- addActionsAndFilters() : void
- Add filters and actions - called from main plugin
- addShortcodes() : void
- Add shortcodes- called from main plugin
- addTaxonomySettings() : void
- register options on options_settings_page
- admin_options_settings() : void
- register options on options_settings_page
- atpOffer_shortcode() : mixed
- offer shortcode for all taxonomy values.
- check_stale_transient() : void
- check if transient is stale (hourly scheduled event)
- create_offer_term() : void
- Create new custom term meta for atp_offers.
- delete_offer_term() : void
- Delete custom term meta for atp_offers.
- edit_offer_term() : void
- Saves custom term meta for atp_offers when data is edited.
- form_input_OfferFlash() : string
- filter for atpCustom_options_form_input_OfferFlash
- form_input_OfferWeek() : string
- filter for atpCustom_options_form_input_OfferWeek
- form_input_templateDates() : string
- filter for atpCustom_options_form_input_templateDates
- form_post_OfferDefault() : mixed
- filter for atpCustom_options_form_post_OfferWeek
- form_post_OfferFlash() : mixed
- filter for atpCustom_options_form_post_OfferFlash
- form_post_OfferWeek() : mixed
- filter for atpCustom_options_form_post_OfferWeek
- form_post_templateDates() : mixed
- filter for atpCustom_options_form_post_templateDates
- get_admin_bar_menu() : void
- process the admin bar item
- get_banner_template() : array<string|int, mixed>
- get banner template (filter).
- get_homepage_template() : array<string|int, mixed>
- get homepage template (filter).
- get_offer_array() : array<string|int, mixed>
- get offer array (filter).
- get_offer_options() : string|array<string|int, mixed>
- get offer array options (filter offer_options)
- get_offer_template() : array<string|int, mixed>
- get offer template (filter).
- get_offer_value() : mixed
- get offer value (filter) filter {classname}_get_variable get a session value
- get_option_addtocart_message() : string
- replace full-pay message (option_wc_deposits_message_full_amount | offer_fullpay_message)
- get_option_custom_css() : string
- get the offer custom style sheet
- get_option_deposit_amount_text() : string
- get offer_deposit_amount_text (filter offer_deposit_amount_text)
- get_option_fullpay_button() : string
- replace full-pay button (option_wc_deposits_button_full_amount | offer_fullpay_button)
- get_option_fullpay_message() : string
- replace full-pay message (option_wc_deposits_message_full_amount | offer_fullpay_message)
- get_option_future_payment_cart() : string
- get offer_future_payment_cart (filter offer_future_payment_cart)
- get_option_future_payment_total() : string
- get offer_future_payment_total (filter offer_future_payment_total)
- get_option_payment_button() : string
- replace deposit button (option_wc_deposits_button_deposit | offer_payment_button)
- get_option_payment_message() : string
- replace deposit message (option_wc_deposits_message_deposit | offer_payment_message)
- get_option_payment_plan_cart() : string
- get offer_payment_plan_cart (filter offer_payment_plan_cart)
- get_option_payment_plan_text() : string
- get offer_payment_plan_text (filter offer_payment_plan_text)
- get_option_payment_plan_total() : string
- get offer_payment_plan_total (filter offer_payment_plan_total)
- get_option_to_pay_text() : string
- get offer_to_pay_text (filter offer_to_pay_text)
- getBannerTemplate() : array<string|int, mixed>
- get banner template
- getBaseOffer() : mixed
- getHomepageTemplate() : array<string|int, mixed>
- get homepage template
- getId() : mixed
- getOfferArray() : array<string|int, mixed>
- get offer array
- getOfferEnd() : mixed
- getOfferIsFlash() : mixed
- getOfferName() : mixed
- getOfferStart() : mixed
- getOfferTemplate() : array<string|int, mixed>
- get offer template
- getOfferValue() : mixed
- get offer value
- getSubOffer() : mixed
- initialize() : void
- initialize method - called from main plugin
- loadBannerTemplate() : array<string|int, mixed>
- load the banner elementor template
- loadHomepageTemplate() : array<string|int, mixed>
- load the homepage elementor template
- offer_bulk_actions() : array<string|int, mixed>
- adds bulk actions to the taxonomy list
- offer_bulk_actions_export() : string
- export from bulk actions
- offer_bulk_actions_handler() : string
- bulk actions
- offer_bulk_actions_import() : string
- import from bulk actions
- offer_debugging() : array<string|int, mixed>
- Get the offer array for debugging
- offer_form_fields() : void
- adds fields to the beginning of the atp_offers taxonomy editor page.
- offer_form_table() : void
- adds fields to the end of the atp_offers taxonomy editor page.
- offer_form_tag() : mixed
- set the enctype of form tag
- offer_form_upload() : void
- adds fields to the end of the "add offer" form so they get submitted in the bulk action.
- offer_list_description() : void
- adds description to our offer page.
- offer_list_notes() : void
- adds notes to our offer page.
- offer_list_row_actions() : array<string|int, mixed>
- adjust offer list row actions.
- offer_list_row_actions_set() : void
- handle offer list row actions (set default).
- offer_list_row_copy() : void
- handle offer list row actions (copy).
- offer_list_row_push() : void
- handle offer list row actions (push).
- offer_styles() : mixed
- output offer specific styles
- output_offer_select_html() : void
- adds offer selection html
- register_offer_taxonomy() : void
- Registers atp_offers taxonomy for products.
- set_admin_bar_menu() : void
- add the admin bar menu
- set_current_offer() : void
- set the current offer (set offerArray) after registered_taxonomy_ action.
- taxonomy_options_post() : void
- options_form_post method - called action options_form_post
- wcd_taxonomy_list_row_actions() : array<string|int, mixed>
- adjust payment plans list row actions. (wc-deposits taxonomy screen)
- wcd_woocommerce_update_options() : string
- update wc-deposits slider titles & messages (woocommerce_update_options_wc-deposits).
Constants
VERSION
public
string
VERSION
= '24.0712.1'
extension version
Properties
$offer_taxonomy_link
public
mixed
$offer_taxonomy_link
$offer_taxonomy_slug
public
string
$offer_taxonomy_slug
link to payment offers taxonomy screen
Methods
__construct()
constructor method
public
__construct(object $plugin) : void
Parameters
- $plugin : object
-
main plugin object
Return values
void —add_backend_style()
custom styles for offer term screen.
public
add_backend_style() : void
Return values
void —add_frontend_style()
custom styles for offer term screen.
public
add_frontend_style() : void
Return values
void —add_settings_menu()
Puts the taxonomy page in the menus - on 'admin_menu' action
public
add_settings_menu() : void
Return values
void —addActionsAndFilters()
Add filters and actions - called from main plugin
public
addActionsAndFilters() : void
Return values
void —addShortcodes()
Add shortcodes- called from main plugin
public
addShortcodes() : void
Return values
void —addTaxonomySettings()
register options on options_settings_page
public
addTaxonomySettings() : void
Tags
Return values
void —admin_options_settings()
register options on options_settings_page
public
admin_options_settings() : void
Tags
Return values
void —atpOffer_shortcode()
offer shortcode for all taxonomy values.
public
atpOffer_shortcode([mixed $atts = null ][, string $content = 'description' ]) : mixed
Parameters
- $atts : mixed = null
- $content : string = 'description'
Return values
mixed —check_stale_transient()
check if transient is stale (hourly scheduled event)
public
check_stale_transient() : void
Return values
void —create_offer_term()
Create new custom term meta for atp_offers.
public
create_offer_term(mixed $term_id, $tt_id[, array<string|int, mixed> $args = null ]) : void
copy default meta data to new offer
Parameters
- $term_id : mixed
- $tt_id :
-
term taxonomy ID
- $args : array<string|int, mixed> = null
-
arguments passed to wp_insert_term().
Return values
void —delete_offer_term()
Delete custom term meta for atp_offers.
public
delete_offer_term(int $term_id, int $tt_id, string $taxonomy, WP_Term $term[, array<string|int, mixed> $object_ids = null ]) : void
delete associated payment plans
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_offer_term()
Saves custom term meta for atp_offers when data is edited.
public
edit_offer_term( $term_id, $tt_id[, array<string|int, mixed> $args = null ]) : void
save price, payments, firstpay as atp_item_{$id} create/update the payment plan w/slug={offer}-{sku}
Parameters
- $term_id :
-
term id being edited
- $tt_id :
-
term taxonomy ID
- $args : array<string|int, mixed> = null
-
arguments passed to wp_insert_term().
Return values
void —form_input_OfferFlash()
filter for atpCustom_options_form_input_OfferFlash
public
form_input_OfferFlash( $html, $fieldName, $metaData, $currentValue) : string
Parameters
- $html :
-
- input html (blank or default text input)
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $currentValue :
-
- the current (stored) value(s)
Return values
string —form_input_OfferWeek()
filter for atpCustom_options_form_input_OfferWeek
public
form_input_OfferWeek( $html, $fieldName, $metaData, $currentValue) : string
Parameters
- $html :
-
- input html (blank or default text input)
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $currentValue :
-
- the current (stored) value(s)
Return values
string —form_input_templateDates()
filter for atpCustom_options_form_input_templateDates
public
form_input_templateDates( $html, $fieldName, $metaData, $currentValue) : string
Parameters
- $html :
-
- input html (blank or default text input)
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $currentValue :
-
- the current (stored) value(s)
Return values
string —form_post_OfferDefault()
filter for atpCustom_options_form_post_OfferWeek
public
form_post_OfferDefault( $value, $fieldName, $metaData, mixed $priorValue) : mixed
Parameters
- $value :
-
- the value POSTed
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $priorValue : mixed
Return values
mixed —form_post_OfferFlash()
filter for atpCustom_options_form_post_OfferFlash
public
form_post_OfferFlash( $value, $fieldName, $metaData, mixed $priorValue) : mixed
Parameters
- $value :
-
- the value POSTed
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $priorValue : mixed
Return values
mixed —form_post_OfferWeek()
filter for atpCustom_options_form_post_OfferWeek
public
form_post_OfferWeek( $value, $fieldName, $metaData, mixed $priorValue) : mixed
Parameters
- $value :
-
- the value POSTed
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $priorValue : mixed
Return values
mixed —form_post_templateDates()
filter for atpCustom_options_form_post_templateDates
public
form_post_templateDates( $value, $fieldName, $metaData, mixed $priorValue) : mixed
Parameters
- $value :
-
- the value POSTed
- $fieldName :
-
- the name of the field/option
- $metaData :
-
- the option metadata
- $priorValue : mixed
Return values
mixed —get_admin_bar_menu()
process the admin bar item
public
get_admin_bar_menu(object $admin_bar) : void
Parameters
- $admin_bar : object
-
wp_admin_bar
Return values
void —get_banner_template()
get banner template (filter).
public
get_banner_template() : array<string|int, mixed>
filter {classname}_get_banner_template get the offer template
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
get_homepage_template()
get homepage template (filter).
public
get_homepage_template() : array<string|int, mixed>
filter {classname}_get_homepage_template get the homepage template
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
get_offer_array()
get offer array (filter).
public
get_offer_array([mixed $offerArray = [] ]) : array<string|int, mixed>
filter {classname}_get_offer get the offer values
Parameters
- $offerArray : mixed = []
Return values
array<string|int, mixed> —- the offer array
get_offer_options()
get offer array options (filter offer_options)
public
get_offer_options(string $default[, string $key = null ]) : string|array<string|int, mixed>
Parameters
- $default : string
-
option value default
- $key : string = null
-
get a key from the array
Return values
string|array<string|int, mixed> —get_offer_template()
get offer template (filter).
public
get_offer_template() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
get_offer_value()
get offer value (filter) filter {classname}_get_variable get a session value
public
get_offer_value(mixed $default, mixed $varName) : mixed
Parameters
- $default : mixed
- $varName : mixed
Return values
mixed —- the value or null
get_option_addtocart_message()
replace full-pay message (option_wc_deposits_message_full_amount | offer_fullpay_message)
public
get_option_addtocart_message([string $message = null ]) : string
Parameters
- $message : string = null
-
option value
Return values
string —get_option_custom_css()
get the offer custom style sheet
public
get_option_custom_css([string $css = null ]) : string
Parameters
- $css : string = null
-
option value
Return values
string —get_option_deposit_amount_text()
get offer_deposit_amount_text (filter offer_deposit_amount_text)
public
get_option_deposit_amount_text([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —get_option_fullpay_button()
replace full-pay button (option_wc_deposits_button_full_amount | offer_fullpay_button)
public
get_option_fullpay_button([string $message = null ]) : string
Parameters
- $message : string = null
-
option value
Return values
string —get_option_fullpay_message()
replace full-pay message (option_wc_deposits_message_full_amount | offer_fullpay_message)
public
get_option_fullpay_message([string $message = null ]) : string
Parameters
- $message : string = null
-
option value
Return values
string —get_option_future_payment_cart()
get offer_future_payment_cart (filter offer_future_payment_cart)
public
get_option_future_payment_cart([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —get_option_future_payment_total()
get offer_future_payment_total (filter offer_future_payment_total)
public
get_option_future_payment_total([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —get_option_payment_button()
replace deposit button (option_wc_deposits_button_deposit | offer_payment_button)
public
get_option_payment_button([string $message = null ]) : string
Parameters
- $message : string = null
-
option value
Return values
string —get_option_payment_message()
replace deposit message (option_wc_deposits_message_deposit | offer_payment_message)
public
get_option_payment_message([string $message = null ]) : string
Parameters
- $message : string = null
-
option value
Return values
string —get_option_payment_plan_cart()
get offer_payment_plan_cart (filter offer_payment_plan_cart)
public
get_option_payment_plan_cart([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —get_option_payment_plan_text()
get offer_payment_plan_text (filter offer_payment_plan_text)
public
get_option_payment_plan_text([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —get_option_payment_plan_total()
get offer_payment_plan_total (filter offer_payment_plan_total)
public
get_option_payment_plan_total([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —get_option_to_pay_text()
get offer_to_pay_text (filter offer_to_pay_text)
public
get_option_to_pay_text([string $default = null ]) : string
Parameters
- $default : string = null
-
option value default
Return values
string —getBannerTemplate()
get banner template
public
getBannerTemplate() : array<string|int, mixed>
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
getBaseOffer()
public
getBaseOffer() : mixed
Return values
mixed —getHomepageTemplate()
get homepage template
public
getHomepageTemplate() : array<string|int, mixed>
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
getId()
public
getId() : mixed
Return values
mixed —getOfferArray()
get offer array
public
getOfferArray([mixed $offerArray = [] ]) : array<string|int, mixed>
Parameters
- $offerArray : mixed = []
Return values
array<string|int, mixed> —- the offer array
getOfferEnd()
public
getOfferEnd([mixed $fmt = null ]) : mixed
Parameters
- $fmt : mixed = null
Return values
mixed —getOfferIsFlash()
public
getOfferIsFlash() : mixed
Return values
mixed —getOfferName()
public
getOfferName() : mixed
Return values
mixed —getOfferStart()
public
getOfferStart([mixed $fmt = null ]) : mixed
Parameters
- $fmt : mixed = null
Return values
mixed —getOfferTemplate()
get offer template
public
getOfferTemplate() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
getOfferValue()
get offer value
public
getOfferValue(mixed $varName[, mixed $default = null ]) : mixed
Parameters
- $varName : mixed
- $default : mixed = null
Return values
mixed —- the value or null
getSubOffer()
public
getSubOffer() : mixed
Return values
mixed —initialize()
initialize method - called from main plugin
public
initialize() : void
Return values
void —loadBannerTemplate()
load the banner elementor template
public
loadBannerTemplate() : array<string|int, mixed>
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
loadHomepageTemplate()
load the homepage elementor template
public
loadHomepageTemplate() : array<string|int, mixed>
Return values
array<string|int, mixed> —[title=>, date=>, id=>]
offer_bulk_actions()
adds bulk actions to the taxonomy list
public
offer_bulk_actions(array<string|int, mixed> $actions) : array<string|int, mixed>
Parameters
- $actions : array<string|int, mixed>
-
current actions
Return values
array<string|int, mixed> —new actions
offer_bulk_actions_export()
export from bulk actions
public
offer_bulk_actions_export(string $redirect_url, string $action, array<string|int, mixed> $term_ids) : string
Parameters
- $redirect_url : string
-
redirect to url
- $action : string
-
current action
- $term_ids : array<string|int, mixed>
-
term iids to act on
Return values
string —$redirect_url redirect to url
offer_bulk_actions_handler()
bulk actions
public
offer_bulk_actions_handler(string $redirect_url, string $action, array<string|int, mixed> $term_ids) : string
Parameters
- $redirect_url : string
-
redirect to url
- $action : string
-
current action
- $term_ids : array<string|int, mixed>
-
term iids to act on
Return values
string —$redirect_url redirect to url
offer_bulk_actions_import()
import from bulk actions
public
offer_bulk_actions_import(string $redirect_url, string $action, array<string|int, mixed> $term_ids) : string
Parameters
- $redirect_url : string
-
redirect to url
- $action : string
-
current action
- $term_ids : array<string|int, mixed>
-
term iids to act on
Return values
string —$redirect_url redirect to url
offer_debugging()
Get the offer array for debugging
public
offer_debugging(mixed $debugging_array) : array<string|int, mixed>
Parameters
- $debugging_array : mixed
Return values
array<string|int, mixed> —extended array with [ extension_name => [key=>value array] ]
offer_form_fields()
adds fields to the beginning of the atp_offers taxonomy editor page.
public
offer_form_fields( $term) : void
remove 'description' and add custom html 'desscription'
Parameters
Return values
void —offer_form_table()
adds fields to the end of the atp_offers taxonomy editor page.
public
offer_form_table( $term) : void
list all 'full unit' products set for wc-deposits with fields for price, payments, firstpay, istrial, and option to create/update or exclude the payment plan.
Parameters
Return values
void —offer_form_tag()
set the enctype of form tag
public
offer_form_tag() : mixed
Return values
mixed —offer_form_upload()
adds fields to the end of the "add offer" form so they get submitted in the bulk action.
public
offer_form_upload() : void
Return values
void —offer_list_description()
adds description to our offer page.
public
offer_list_description() : void
Return values
void —offer_list_notes()
adds notes to our offer page.
public
offer_list_notes() : void
Return values
void —offer_list_row_actions()
adjust offer list row actions.
public
offer_list_row_actions(array<string|int, mixed> $actions, object $term) : array<string|int, mixed>
set default offer
Parameters
- $actions : array<string|int, mixed>
-
Array of actions.
- $term : object
-
Term object.
Return values
array<string|int, mixed> —offer_list_row_actions_set()
handle offer list row actions (set default).
public
offer_list_row_actions_set() : void
Return values
void —offer_list_row_copy()
handle offer list row actions (copy).
public
offer_list_row_copy(mixed $term_id) : void
Parameters
- $term_id : mixed
Return values
void —offer_list_row_push()
handle offer list row actions (push).
public
offer_list_row_push(mixed $term_id) : void
Parameters
- $term_id : mixed
Return values
void —offer_styles()
output offer specific styles
public
offer_styles() : mixed
Return values
mixed —output_offer_select_html()
adds offer selection html
public
output_offer_select_html([array<string|int, mixed> $selected = [] ]) : void
Parameters
- $selected : array<string|int, mixed> = []
Return values
void —register_offer_taxonomy()
Registers atp_offers taxonomy for products.
public
register_offer_taxonomy() : void
'registered_taxonomy_'.WC_DEPOSITS_PAYMENT_PLAN_TAXONOMY
Return values
void —set_admin_bar_menu()
add the admin bar menu
public
set_admin_bar_menu(object $admin_bar) : void
Parameters
- $admin_bar : object
-
wp_admin_bar
Return values
void —set_current_offer()
set the current offer (set offerArray) after registered_taxonomy_ action.
public
set_current_offer() : void
called after all plugins are loaded and wordpress is ready
Return values
void —taxonomy_options_post()
options_form_post method - called action options_form_post
public
taxonomy_options_post(mixed $optionMetaPosted) : void
Parameters
- $optionMetaPosted : mixed
Return values
void —wcd_taxonomy_list_row_actions()
adjust payment plans list row actions. (wc-deposits taxonomy screen)
public
wcd_taxonomy_list_row_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> —wcd_woocommerce_update_options()
update wc-deposits slider titles & messages (woocommerce_update_options_wc-deposits).
public
wcd_woocommerce_update_options() : string
re-save options without wp_kses-ing them (allow full html) and duplicate to offer defaults.