Changeset 3334315
- Timestamp:
- 07/25/2025 07:28:32 PM (8 months ago)
- Location:
- uncanny-automator/trunk
- Files:
-
- 10 edited
-
languages/uncanny-automator.pot (modified) (20 diffs)
-
readme.txt (modified) (2 diffs)
-
src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php (modified) (1 diff)
-
src/integrations/thrive-apprentice/thrive-apprentice-integration.php (modified) (2 diffs)
-
src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php (modified) (4 diffs)
-
src/integrations/thrive-quiz-builder/add-thrive-quiz-builder-integration.php (modified) (1 diff)
-
src/integrations/thrive-ultimatum/class-thrive-ultimatum-integration.php (modified) (1 diff)
-
uncanny-automator.php (modified) (2 diffs)
-
vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uncanny-automator/trunk/languages/uncanny-automator.pot
r3333864 r3334315 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Uncanny Automator 6.7.0 \n"5 "Project-Id-Version: Uncanny Automator 6.7.0.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/uncanny-automator\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-07-2 4T16:51:15+00:00\n"12 "POT-Creation-Date: 2025-07-25T18:38:56+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 31298 31298 #: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:141 31299 31299 #: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:144 31300 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:109 031300 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1094 31301 31301 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:260 31302 31302 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:263 … … 31349 31349 #: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:171 31350 31350 #: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:174 31351 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:109 131351 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1095 31352 31352 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-completes-all-free-lessons-in-premium-course.php:159 31353 31353 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-completes-all-free-lessons-in-premium-course.php:162 … … 31389 31389 msgstr "" 31390 31390 31391 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1 0731392 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:11 031391 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:111 31392 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:114 31393 31393 msgctxt "Thrive Apprentice" 31394 31394 msgid "Any course" 31395 31395 msgstr "" 31396 31396 31397 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1 7631397 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:180 31398 31398 msgctxt "Content type selection" 31399 31399 msgid "Any content type" 31400 31400 msgstr "" 31401 31401 31402 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:25 031403 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:2 6631402 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:254 31403 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:270 31404 31404 msgctxt "Thrive Apprentice" 31405 31405 msgid "Any content" 31406 31406 msgstr "" 31407 31407 31408 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:3 2631409 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:38 231408 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:330 31409 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:386 31410 31410 msgctxt "Thrive Apprentice lesson selection" 31411 31411 msgid "Any lesson" 31412 31412 msgstr "" 31413 31413 31414 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:43 131415 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:5 1631414 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:435 31415 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:520 31416 31416 msgctxt "Module selection" 31417 31417 msgid "Any module" … … 31419 31419 31420 31420 #. translators: %s is replaced with the error message 31421 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:47 331421 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:477 31422 31422 #, php-format 31423 31423 msgctxt "Error message" … … 31425 31425 msgstr "" 31426 31426 31427 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:61 131427 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:615 31428 31428 msgctxt "Assessment selection" 31429 31429 msgid "Any assessment" 31430 31430 msgstr "" 31431 31431 31432 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:78 531432 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:789 31433 31433 msgctxt "Product selection" 31434 31434 msgid "Any product" … … 31436 31436 31437 31437 #. translators: %s is replaced with the content type name 31438 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:97 531438 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:979 31439 31439 #, php-format 31440 31440 msgctxt "Thrive Apprentice" … … 31443 31443 31444 31444 #. translators: %s is replaced with the content type name 31445 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:102 331445 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1027 31446 31446 #, php-format 31447 31447 msgctxt "Content type name" … … 31450 31450 31451 31451 #. translators: %s is replaced with the content type name 31452 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:104 231453 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:10 5631452 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1046 31453 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1060 31454 31454 #, php-format 31455 31455 msgctxt "Error message" … … 31458 31458 31459 31459 #. translators: %s is replaced with the content type name 31460 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:107 031460 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1074 31461 31461 #, php-format 31462 31462 msgctxt "Content type name" … … 31464 31464 msgstr "" 31465 31465 31466 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:109 231466 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1096 31467 31467 msgctxt "Thrive Apprentice" 31468 31468 msgid "Course author" 31469 31469 msgstr "" 31470 31470 31471 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:109 331471 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1097 31472 31472 msgctxt "Thrive Apprentice" 31473 31473 msgid "Course summary" 31474 31474 msgstr "" 31475 31475 31476 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:109 431476 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1098 31477 31477 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:266 31478 31478 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:269 … … 31499 31499 msgstr "" 31500 31500 31501 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:11 0731501 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1111 31502 31502 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:198 31503 31503 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:201 … … 31508 31508 msgstr "" 31509 31509 31510 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:11 0831510 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1112 31511 31511 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-module-completed.php:180 31512 31512 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-module-completed.php:183 … … 31515 31515 msgstr "" 31516 31516 31517 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:11 0931517 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1113 31518 31518 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:204 31519 31519 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:207 … … 31524 31524 msgstr "" 31525 31525 31526 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:112 231526 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1126 31527 31527 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:174 31528 31528 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:177 … … 31531 31531 msgstr "" 31532 31532 31533 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:112 331533 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1127 31534 31534 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:180 31535 31535 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:183 … … 31538 31538 msgstr "" 31539 31539 31540 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:112 431540 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1128 31541 31541 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:186 31542 31542 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:189 … … 31569 31569 msgstr "" 31570 31570 31571 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:37 31571 #. translators: %1$s: Product Name 31572 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:58 31572 31573 #, php-format 31573 31574 msgctxt "Thrive Apprentice" … … 31575 31576 msgstr "" 31576 31577 31577 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php: 4331578 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:64 31578 31579 msgctxt "Thrive Apprentice" 31579 31580 msgid "A user receives access to {{a product}}" 31580 31581 msgstr "" 31581 31582 31582 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php: 5631583 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:79 31583 31584 msgctxt "Thrive Apprentice" 31584 31585 msgid "Product" 31585 31586 msgstr "" 31586 31587 31587 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:12 131588 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:12 431588 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:120 31589 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:123 31589 31590 msgctxt "Thrive Apprentice" 31590 31591 msgid "Product ID" 31591 31592 msgstr "" 31592 31593 31593 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:12 731594 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:1 3031594 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:126 31595 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:129 31595 31596 msgctxt "Thrive Apprentice" 31596 msgid "Product title"31597 msgid "Product name" 31597 31598 msgstr "" 31598 31599 -
uncanny-automator/trunk/readme.txt
r3333891 r3334315 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.3 7 Stable tag: 6.7.0 7 Stable tag: 6.7.0.1 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 394 394 == Changelog == 395 395 396 = 6.7.0.1 [2025-07-25] = 397 398 **Update:** 399 400 * Thrive Apprentice - `class_alias` added to support older Automator Pro versions 401 396 402 = 6.7.0 [2025-07-24] = 397 403 -
uncanny-automator/trunk/src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php
r3333864 r3334315 1 1 <?php 2 2 namespace Uncanny_Automator\Integrations\Thrive_Apprentice; 3 4 5 // Create class alias for backward compatibility with Pro plugin 6 class_alias( 'Uncanny_Automator\Integrations\Thrive_Apprentice\Thrive_Apprentice_Helpers', 'Uncanny_Automator\Thrive_Apprentice_Helpers' ); 3 7 4 8 /** -
uncanny-automator/trunk/src/integrations/thrive-apprentice/thrive-apprentice-integration.php
r3333864 r3334315 37 37 new THRIVE_APPRENTICE_USER_PASS_ASSESSMENT_IN_COURSE($this->helpers); 38 38 new THRIVE_APPRENTICE_USER_SUBMITS_ASSESSMENT_IN_COURSE($this->helpers); 39 new THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED($this->helpers); 39 40 } 40 41 … … 48 49 */ 49 50 public function plugin_active() { 50 return class_exists( '\TVA_ Manager');51 return class_exists( '\TVA_Const', false ); 51 52 } 52 53 } -
uncanny-automator/trunk/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php
r3333864 r3334315 1 1 <?php 2 namespace Uncanny_Automator ;2 namespace Uncanny_Automator\Integrations\Thrive_Apprentice; 3 3 4 4 use Uncanny_Automator\Recipe\Trigger; 5 5 6 6 /** 7 * Class THRIVE_APPRENTICE_ PRODUCT_ACCESS_RECEIVED7 * Class THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED 8 8 * 9 * @package Uncanny_Automator 9 10 */ 10 class THRIVE_APPRENTICE_ PRODUCT_ACCESS_RECEIVED extends Trigger {11 class THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED extends Trigger { 11 12 12 const TRIGGER_CODE = 'THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED';13 const TRIGGER_META = 'THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED_META';14 15 /**16 * @var Thrive_Apprentice_Helpers17 */18 13 protected $helper; 19 14 20 15 /** 21 * Setup trigger. 16 * Constant TRIGGER_CODE. 17 * 18 * @var string 19 */ 20 const TRIGGER_CODE = 'THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED'; 21 22 /** 23 * Constant TRIGGER_META. 24 * 25 * @var string 26 */ 27 const TRIGGER_META = 'THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED_META'; 28 29 30 /** 31 * Define and register the trigger by pushing it into the Automator object. 32 * 33 * @return void. 22 34 */ 23 35 protected function setup_trigger() { 24 $this->helper = new Thrive_Apprentice_Helpers( false ); 36 37 $this->helper = array_shift( $this->dependencies ); 25 38 26 39 $this->set_integration( 'THRIVE_APPRENTICE' ); 40 27 41 $this->set_trigger_code( self::TRIGGER_CODE ); 42 28 43 $this->set_trigger_meta( self::TRIGGER_META ); 44 29 45 $this->set_is_pro( false ); 30 46 47 $this->set_is_login_required( true ); 48 49 // The action hook to attach this trigger into. 31 50 $this->add_action( 'tva_user_receives_product_access' ); 51 52 // The number of arguments that the action hook accepts. 32 53 $this->set_action_args_count( 2 ); 33 54 34 55 $this->set_sentence( 35 // translators: %1$s: Product Name36 56 sprintf( 57 /* translators: %1$s: Product Name */ 37 58 esc_html_x( 'A user receives access to {{a product:%1$s}}', 'Thrive Apprentice', 'uncanny-automator' ), 38 59 $this->get_trigger_meta() … … 46 67 47 68 /** 48 * Options.69 * Loads all options. 49 70 * 50 * @return mixed71 * @return array The list of options. 51 72 */ 52 73 public function options() { 74 53 75 return array( 54 76 array( 55 77 'option_code' => $this->get_trigger_meta(), 78 'required' => true, 56 79 'label' => esc_html_x( 'Product', 'Thrive Apprentice', 'uncanny-automator' ), 57 80 'input_type' => 'select', 58 'required' => true, 59 'options' => $this->helper->get_dropdown_options_products( true, true ), 81 'options' => $this->get_helper()->get_dropdown_options_products(true, true), 60 82 'relevant_tokens' => array(), 61 83 ), … … 64 86 65 87 /** 66 * Validate .88 * Validate the trigger. 67 89 * 68 * @param mixed $trigger The trigger.69 * @param mixed $hook_args Thearguments.70 * @return mixed90 * @param array $trigger The trigger data. 91 * @param array $hook_args The hook arguments. 92 * @return bool True if validation was successful. 71 93 */ 72 94 public function validate( $trigger, $hook_args ) { 73 list( $user, $product ) = $hook_args;95 list( $user, $product_id ) = $hook_args; 74 96 75 if ( empty( $user ) || empty( $product ) ) {97 if ( empty( $user ) || empty( $product_id ) ) { 76 98 return false; 77 99 } 78 100 79 $selected_product_id = intval( $trigger['meta'][ $this->get_trigger_meta() ] ); 80 $user_id = $user instanceof \WP_User ? $user->ID : intval( $user ); 101 $this->set_user_id( absint( $user->ID ) ); 81 102 82 $this->set_user_id( $user_id ); 103 $product_id = absint( $product_id ); 104 $selected_product_id = $trigger['meta'][ $this->get_trigger_meta() ]; 83 105 84 if ( -1 === $selected_product_id ) {85 return true;86 }106 // Match if any product is selected (-1) or if specific product matches 107 return intval( '-1' ) === intval( $selected_product_id ) || (int) $selected_product_id === (int) $product_id; 108 } 87 109 88 $product_id = $this->get_product_id( $product ); 89 90 return $product_id === $selected_product_id; 110 /** 111 * Define tokens. 112 * 113 * @param array $trigger The trigger configuration. 114 * @param array $tokens The existing tokens. 115 * @return array 116 */ 117 public function define_tokens( $trigger, $tokens ) { 118 return array( 119 'PRODUCT_ID' => array( 120 'name' => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ), 121 'type' => 'int', 122 'tokenId' => 'PRODUCT_ID', 123 'tokenName' => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ), 124 ), 125 'PRODUCT_NAME' => array( 126 'name' => esc_html_x( 'Product name', 'Thrive Apprentice', 'uncanny-automator' ), 127 'type' => 'text', 128 'tokenId' => 'PRODUCT_NAME', 129 'tokenName' => esc_html_x( 'Product name', 'Thrive Apprentice', 'uncanny-automator' ), 130 ), 131 ); 91 132 } 92 133 … … 94 135 * Hydrate tokens. 95 136 * 96 * @param mixed $trigger The trigger.97 * @param mixed $hook_args Thearguments.98 * @return mixed137 * @param array $trigger The trigger data. 138 * @param array $hook_args The hook arguments. 139 * @return array The token values. 99 140 */ 100 141 public function hydrate_tokens( $trigger, $hook_args ) { 101 list( $user, $product ) = $hook_args;142 list( $user, $product_id ) = $hook_args; 102 143 103 $product_data = $this->get_product_data( $product ); 144 if ( empty( $product_id ) ) { 145 return array(); 146 } 147 148 $product = new \TVA\Product( $product_id ); 104 149 105 150 return array( 106 'PRODUCT_ID' => $product_data['id'], 107 'PRODUCT_TITLE' => $product_data['title'], 108 ); 109 } 110 111 /** 112 * Define tokens. 113 * 114 * @param mixed $trigger The trigger. 115 * @param mixed $tokens The destination. 116 * @return mixed 117 */ 118 public function define_tokens( $trigger, $tokens ) { 119 return array( 120 'PRODUCT_ID' => array( 121 'name' => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ), 122 'type' => 'int', 123 'tokenId' => 'PRODUCT_ID', 124 'tokenName' => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ), 125 ), 126 'PRODUCT_TITLE' => array( 127 'name' => esc_html_x( 'Product title', 'Thrive Apprentice', 'uncanny-automator' ), 128 'type' => 'text', 129 'tokenId' => 'PRODUCT_TITLE', 130 'tokenName' => esc_html_x( 'Product title', 'Thrive Apprentice', 'uncanny-automator' ), 131 ), 132 ); 133 } 134 135 /** 136 * Extract product ID from various product object types 137 * 138 * @param mixed $product 139 * @return int|null 140 */ 141 private function get_product_id( $product ) { 142 // TVA\Product object 143 if ( is_object( $product ) && method_exists( $product, 'get_id' ) ) { 144 return intval( $product->get_id() ); 145 } 146 147 // WP_Term object (product term) 148 if ( $product instanceof \WP_Term && 'tva_product' === $product->taxonomy ) { 149 return intval( $product->term_id ); 150 } 151 152 // Numeric value 153 if ( is_numeric( $product ) ) { 154 return intval( $product ); 155 } 156 157 // Array with ID 158 if ( is_array( $product ) && isset( $product['ID'] ) ) { 159 return intval( $product['ID'] ); 160 } 161 162 // Array with term_id 163 if ( is_array( $product ) && isset( $product['term_id'] ) ) { 164 return intval( $product['term_id'] ); 165 } 166 167 // TVA\Product object with get_term_id method 168 if ( is_object( $product ) && method_exists( $product, 'get_term_id' ) ) { 169 return intval( $product->get_term_id() ); 170 } 171 172 // Object with term_id property 173 if ( is_object( $product ) && isset( $product->term_id ) ) { 174 return intval( $product->term_id ); 175 } 176 177 return null; 178 } 179 180 /** 181 * Extract product data (ID and title) from various product object types 182 * 183 * @param mixed $product 184 * @return array 185 */ 186 private function get_product_data( $product ) { 187 $product_id = null; 188 $product_title = ''; 189 190 // TVA\Product object 191 if ( is_object( $product ) && method_exists( $product, 'get_id' ) ) { 192 $product_id = $product->get_id(); 193 $product_title = method_exists( $product, 'get_name' ) ? $product->get_name() : ''; 194 } elseif ( $product instanceof \WP_Term && 'tva_product' === $product->taxonomy ) { 195 // WP_Term object (product term) 196 $product_id = $product->term_id; 197 $product_title = $product->name; 198 } elseif ( is_numeric( $product ) ) { 199 // Numeric value 200 $product_id = intval( $product ); 201 $product_term = get_term( $product_id, 'tva_product' ); 202 $product_title = $product_term instanceof \WP_Term ? $product_term->name : ''; 203 } elseif ( is_array( $product ) && isset( $product['ID'] ) ) { 204 // Array with ID 205 $product_id = intval( $product['ID'] ); 206 $product_title = isset( $product['name'] ) ? $product['name'] : ''; 207 } elseif ( is_array( $product ) && isset( $product['term_id'] ) ) { 208 // Array with term_id 209 $product_id = intval( $product['term_id'] ); 210 $product_title = isset( $product['name'] ) ? $product['name'] : ''; 211 } elseif ( is_object( $product ) && method_exists( $product, 'get_term_id' ) ) { 212 // TVA\Product object with get_term_id method 213 $product_id = $product->get_term_id(); 214 $product_title = method_exists( $product, 'get_name' ) ? $product->get_name() : ''; 215 } elseif ( is_object( $product ) && isset( $product->term_id ) ) { 216 // Object with term_id property 217 $product_id = $product->term_id; 218 $product_title = isset( $product->name ) ? $product->name : ''; 219 } 220 221 return array( 222 'id' => $product_id, 223 'title' => $product_title, 151 'PRODUCT_ID' => $product_id, 152 'PRODUCT_NAME' => $product->get_name(), 224 153 ); 225 154 } -
uncanny-automator/trunk/src/integrations/thrive-quiz-builder/add-thrive-quiz-builder-integration.php
r2901959 r3334315 34 34 */ 35 35 public function plugin_active() { 36 return class_exists( 'Thrive_Quiz_Builder' );36 return class_exists( 'Thrive_Quiz_Builder', false ); 37 37 } 38 38 } -
uncanny-automator/trunk/src/integrations/thrive-ultimatum/class-thrive-ultimatum-integration.php
r3265280 r3334315 40 40 */ 41 41 public function plugin_active() { 42 return class_exists( 'TVE_Ult_Const' );42 return class_exists( 'TVE_Ult_Const', false ); 43 43 } 44 44 } -
uncanny-automator/trunk/uncanny-automator.php
r3333864 r3334315 10 10 * License: GPLv3 11 11 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 12 * Version: 6.7.0 12 * Version: 6.7.0.1 13 13 * Requires at least: 5.6 14 14 * Requires PHP: 7.3 … … 23 23 * Specify Automator version. 24 24 */ 25 define( 'AUTOMATOR_PLUGIN_VERSION', '6.7.0 ' );25 define( 'AUTOMATOR_PLUGIN_VERSION', '6.7.0.1' ); 26 26 } 27 27 -
uncanny-automator/trunk/vendor/composer/autoload_classmap.php
r3333864 r3334315 840 840 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_FAIL_ASSESSMENT_IN_COURSE' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-fail-assessment-in-course.php', 841 841 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PASS_ASSESSMENT_IN_COURSE' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-pass-assessment-in-course.php', 842 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php', 842 843 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_SUBMITS_ASSESSMENT_IN_COURSE' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-submits-assessment-in-course.php', 843 844 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\Thrive_Apprentice_Helpers' => $baseDir . '/src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php', … … 1217 1218 'Uncanny_Automator\\TELEGRAM_MESSAGE_RECEIVED' => $baseDir . '/src/integrations/telegram/triggers/telegram-message-received.php', 1218 1219 'Uncanny_Automator\\TELEGRAM_SEND_MESSAGE' => $baseDir . '/src/integrations/telegram/actions/telegram-send-message.php', 1219 'Uncanny_Automator\\THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php',1220 1220 'Uncanny_Automator\\THRIVE_OVATION_TESTIMONIAL_CREATED' => $baseDir . '/src/integrations/thrive-ovation/triggers/thrive-ovation-testimonial-created.php', 1221 1221 'Uncanny_Automator\\TL_FORM_SUBMITTED' => $baseDir . '/src/integrations/thrive-leads/triggers/tl-form-submitted.php', -
uncanny-automator/trunk/vendor/composer/autoload_static.php
r3333864 r3334315 851 851 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_FAIL_ASSESSMENT_IN_COURSE' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-fail-assessment-in-course.php', 852 852 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PASS_ASSESSMENT_IN_COURSE' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-pass-assessment-in-course.php', 853 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php', 853 854 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_SUBMITS_ASSESSMENT_IN_COURSE' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-submits-assessment-in-course.php', 854 855 'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\Thrive_Apprentice_Helpers' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php', … … 1228 1229 'Uncanny_Automator\\TELEGRAM_MESSAGE_RECEIVED' => __DIR__ . '/../..' . '/src/integrations/telegram/triggers/telegram-message-received.php', 1229 1230 'Uncanny_Automator\\TELEGRAM_SEND_MESSAGE' => __DIR__ . '/../..' . '/src/integrations/telegram/actions/telegram-send-message.php', 1230 'Uncanny_Automator\\THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php',1231 1231 'Uncanny_Automator\\THRIVE_OVATION_TESTIMONIAL_CREATED' => __DIR__ . '/../..' . '/src/integrations/thrive-ovation/triggers/thrive-ovation-testimonial-created.php', 1232 1232 'Uncanny_Automator\\TL_FORM_SUBMITTED' => __DIR__ . '/../..' . '/src/integrations/thrive-leads/triggers/tl-form-submitted.php',
Note: See TracChangeset
for help on using the changeset viewer.