HEX
Server: Apache/2
System: Linux cat17246.lnwhostname.com 3.10.0-1160.53.1.el7.x86_64 #1 SMP Fri Jan 14 13:59:45 UTC 2022 x86_64
User: firststeps (1017)
PHP: 7.3.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/firststeps/public_html/wp-content/plugins/jetformbuilder/modules/jobs/traits/job-trait.php
<?php


namespace JFB_Modules\Jobs\Traits;

use JFB_Modules\Post_Type\Module;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die();
}

trait Job_Trait {

	private $hook = '';
	private $args = array();

	public function set_hook( string $hook ) {
		$this->hook = sprintf( 'jet-form-builder/as/%s', $hook );
	}

	public function get_hook(): string {
		return $this->hook;
	}

	public function set_arg( $name, $value ) {
		$this->args[ $name ] = $value;
	}

	public function get_arg( $name ) {
		return $this->args[ $name ] ?? false;
	}

	public function set_args( array $args ) {
		$this->args = $args;
	}

	public function get_args(): array {
		return $this->args;
	}

	public function unschedule() {
		if ( empty( $this->get_args() ) ) {
			as_unschedule_all_actions( $this->get_hook() );

			return;
		}

		as_unschedule_action( $this->get_hook(), $this->get_args(), Module::SLUG );
	}

	public function is_scheduled(): bool {
		if ( ! function_exists( 'as_has_scheduled_action' ) ) {
			return false;
		}

		$args = $this->get_args();
		// null will matches any args
		$args = $args ?: null;

		return as_has_scheduled_action( $this->get_hook(), $args, Module::SLUG );
	}

}