ActionScheduler_Logger::log_failed_fetch_action
Log the failure of fetching the action.
Method of the class: ActionScheduler_Logger{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ActionScheduler_Logger = new ActionScheduler_Logger(); $ActionScheduler_Logger->log_failed_fetch_action( $action_id, ?Exception $exception );
- $action_id(string) (required)
- Action ID.
- ?Exception $exception
- .
Default: null
ActionScheduler_Logger::log_failed_fetch_action() ActionScheduler Logger::log failed fetch action code WC 10.3.6
public function log_failed_fetch_action( $action_id, ?Exception $exception = null ) {
if ( ! is_null( $exception ) ) {
/* translators: %s: exception message */
$log_message = sprintf( __( 'There was a failure fetching this action: %s', 'woocommerce' ), $exception->getMessage() );
} else {
$log_message = __( 'There was a failure fetching this action', 'woocommerce' );
}
$this->log( $action_id, $log_message );
}