job_action_factory = &$job_action_factory; if ( ! ( is_int( $job_id ) && $job_id > 0 ) ) { throw new InvalidArgumentException( 'Invalid job id provided, received: ' . serialize( $job_id ) ); } $this->job_id = $job_id; } /** * @return array containing the wp ajax callback function at index 0 and the * arguments to be used (array of fields for the requested job) at index 1. */ public function run() { try { return array( 'wp_send_json_success', $this->job_action_factory->field_contents( $this->job_id )->run() ); } catch ( Exception $e ) { return array( 'wp_send_json_error', 0 ); } } }