HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/woocommerce-zapier/legacy/Trigger/Order/StatusChange.php
<?php

namespace OM4\Zapier\Trigger\Order;

use OM4\Zapier\Feed\Feed;
use OM4\Zapier\Trigger\Order\Base;

defined( 'ABSPATH' ) || exit;

/**
 * Describe Order Status change Trigger
 *
 * @deprecated 2.0.0
 */
class StatusChange extends Base {

	/**
	 * Constructor
	 */
	public function __construct() {

		// Prefix the trigger key with wc. to denote that this is a trigger that relates to a WooCommerce order.
		$this->trigger_key = 'wc.order_status_change';

		$this->sort_order = 3;

		$this->trigger_title = __( 'New Order Status Change', 'woocommerce-zapier' );

		// Translators: %1$s: URL of the Advanced usage in the WooCommerce Zapier documentation.
		$this->trigger_description = sprintf( __( 'Advanced: triggers every time an order changes status.<br />Consider using with a Filter.<br />See the <a href="%1$s" target="_blank">Advanced Zaps documentation</a> for more information.', 'woocommerce-zapier' ), 'https://docs.om4.io/woocommerce-zapier/legacy/#advanced-zaps' );

		// This hook accepts 3 parameters, and we need all of them.
		// The first parameter is the Order ID (an integer).
		// The second parameter is the old/previous status (a string).
		// The third parameter is the new status (a string).
		$this->actions['woocommerce_order_status_changed'] = 3;

		parent::__construct();
	}

	/**
	 * After sending order data to Zapier, log the previous and new order status as part of the order note.
	 *
	 * @param Feed   $feed         Feed data.
	 * @param array  $result       Response from the wp_remote_post() call.
	 * @param string $action_name  Hook/action name (needed to be able to retry failed attempts).
	 * @param array  $arguments    Hook/action arguments (needed to be able to retry failed attempts).
	 * @param int    $num_attempts The number of attempts it took to successfully send the data to Zapier.
	 *
	 * @return string
	 */
	protected function data_sent_note_suffix( Feed $feed, $result, $action_name, $arguments, $num_attempts = 0 ) {
		if ( isset( $arguments[1] ) && isset( $arguments[2] ) ) {
			$previous_status = $arguments[1];
			$new_status      = $arguments[2];
			return "<br />(<small>$previous_status &rarr; $new_status</small>)";
		}
	}
}