-
Notifications
You must be signed in to change notification settings - Fork 2
Thrive Automator App
valentinjurca edited this page May 12, 2022
·
1 revision
Apps represent the applications or categories to which triggers/actions belong to and are mostly used for grouping items inside an automation. For example, triggers and actions related to WooCommerce implementation are stored under the WooCommerce App.
To create your own App you need to extend Thrive\Automator\Items\App and implement the required basic methods.
-
abstract public static function get_id(): string- should return a unique identifier that will be displayed in the automation editor. To avoid conflicts or overwrites we suggest using a prefix
public static function get_id(): string {
return 'woocommerce';
}-
abstract public static function get_name(): string- the name of the app that will be displayed in the admin UI
public static function get_name(): string {
return 'WooCommerce';
}-
abstract public static function get_description(): string- a short description for the field to help users understand what it represents
public static function get_description(): string {
return 'This app contains WooCommerce integration with Thrive Automator';
}-
abstract public static function get_logo(): string- a nice image to be displayed on the app card inside the automation editor
public static function get_logo(): string {
return 'tap-woocommerce-logo';
}-
public static function has_access(): string- can be used to condition the display of the app in the Automator UI
public static function has_access() {
return class_exists( 'WooCommerce' );
}-
public static function get_acccess_url(): string- provides an url where the user can learn more about the application and how to get access its features
public static function get_acccess_url() {
return 'https://woocommerce.com/';
}To register a App so it can be used by data objects and filters, we should use the thrive_automator_register_app function which receives as the only parameter, the class name.