WordPress at Your Fingertips
function is not described

CronExpression::setPart() public WC 1.0

Set part of the CRON expression

{} It's a method of the class: CronExpression{}

No Hooks.




$CronExpression = new CronExpression();
$CronExpression->setPart( $position, $value );
$position(int) (required)
The position of the CRON expression to set
$value(string) (required)
The value to set

Code of CronExpression::setPart() WC 6.1.1

public function setPart($position, $value)
    if (!$this->fieldFactory->getField($position)->validate($value)) {
        throw new InvalidArgumentException(
            'Invalid CRON field value ' . $value . ' as position ' . $position

    $this->cronParts[$position] = $value;

    return $this;