Register custom post type status.

@param string $status
@param array  $args
506992
protected function prepareStatus(string $status, array $args)
    {
        $this->status[$status] = $this->parseStatusArguments($status, $args);

        // Remove default publish metabox.
        $this->action->add('add_meta_boxes', function () {
            remove_meta_box('submitdiv', $this->slug, 'side');
        });

        // Apply selected status on save.
        $this->filter->add([
            'pre_post_status',
            'status_save_pre'
        ], [$this, 'applyStatus']);

        // Expose post type status for JS use.
        $this->filter->add('themosis_admin_global', function ($data) {
            $status['draft'] = $this->parseStatusArguments('draft', [
                'publish_text' => __('Save Draft')
            ]);

            $data['post_types'][$this->slug] = ['statuses' => array_merge($status, $this->status)];

            return $data;
        });

        // Reorder the list of statuses on the list table.
        // Put the "trash" item as the last one.
        $this->filter->add("views_edit-{$this->slug}", function ($views) {
            if (array_key_exists('trash', $views)) {
                $trash = $views['trash'];
                unset($views['trash']);
                end($views);
                $views['trash'] = $trash;
            }

            return $views;
        });
    }
270699
public function setStatus($status)
    {
        $validStatus = [
            100,
            101,
            102,
            200,
            201,
            202,
            203,
            204,
            205,
            206,
            207,
            208,
            300,
            301,
            302,
            303,
            304,
            305,
            306,
            307,
            400,
            401,
            402,
            403,
            404,
            405,
            406,
            407,
            408,
            409,
            410,
            411,
            412,
            413,
            414,
            415,
            416,
            417,
            418,
            422,
            423,
            424,
            425,
            426,
            428,
            429,
            431,
            500,
            501,
            502,
            503,
            504,
            505,
            506,
            507,
            508,
            511,
        ];

        if (false === in_array($status, $validStatus, false)) {
            throw new \InvalidArgumentException(sprintf(
                'Provided status does not match a valid HTTP Status Code.',
                $status
            ));
        }
        $this->status = (int) $status;
    }
1160903
public function register( $post_types = [] ) {
		foreach ( $post_types as $post_type => $callback ) {
			$this->post_types[ $post_type ] = [
				'callback' => $callback,
			];
		}
	}
1108498
public function setArguments(array $args): PostTypeInterface
    {
        $this->args = array_merge($this->args, $args);

        return $this;
    }
1059945
public function setStatus($status)
    {
        if (!$status instanceof Status) {
            $status = new Status($status);
        }
        $this->status = $status;
    }
147674
public function setSendStatus($sendStatus, $arguments = array())
    {
        $this->sendStatus = $sendStatus;
        $this->sendStatusArguments = $arguments;
        return $this;
    }
1022511
public function status($status = null)
    {
        if (!is_null($status)) {
            $this->status = (int) $status;
        }

        return $this->status;
    }
1228150
protected function register(array $args)
    {
        array_walk($args, function (array $value, string $key) {
            \genesis_register_layout($key, $value);
        });
    }
347324
public function post($resource, array $args = [], array $options = [])
    {
        if (!empty($options)) {
            $this->setOptions($options, $resource);
        }
        $result = $this->_call('POST', $resource[0], $resource[1], $args);

        if (!empty($this->changed)) {
            $this->setSettings();
        }
        return $result;
    }
92392
public static function setResponseStatus(int $status) : void
    {
        if (array_key_exists($status, Http::$http_status_messages)) {
            header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]);
        }
    }
719578
public function setStatusUser($status)
    {
        $options = $id = $result = null;

        if ($this->getParam('all')) {
            $options = array();
        } else {

            $id = $this->getParam(0);

            if (!is_numeric($id)) { // Allow 0 for roleless users
                $this->errorAndExit($this->text('Invalid argument'));
            }

            if ($this->getParam('role')) {
                $options = array('role_id' => $id);
            } else if ($this->getParam('store')) {
                $options = array('store_id' => $id);
            }
        }

        if (isset($options)) {

            $updated = $count = 0;
            foreach ($this->user->getList($options) as $item) {
                $count++;
                $updated += (int) $this->user->update($item['user_id'], array('status' => (bool) $status));
            }

            $result = $count && $count == $updated;

        } else if (isset($id)) {
            $result = $this->user->update($id, array('status' => (bool) $status));
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1135660
public function approve( $args, $assoc_args ) {
		$this->check_server_name();
		foreach ( $args as $id ) {
			$this->set_status( $id, 'approve', 'Approved' );
		}
	}
952985
public static function SetStatus(int $status, bool $exit = false) :void
        {
            if (!HttpStatusCode::IsSupported($status)) {
                throw new \Error("Status code {$status} is not supported");
            }

            self::$status = $status;
            self::AddHeader('Status', $status);

            if ($exit) {
                self::ApplyHeaders();
                exit();
            }
        }
745697
public function register( $args = [ ] ) {
		foreach ( $this->getConfigKeys() as $contentType ) {
			$this->registerContentType(
				$contentType,
				$this->config->getSubConfig( $contentType )
			);
		}
	}
280664
protected function validateStatus(Enums\SearchStatus $status): void
    {
        if (!$status->equals(Enums\SearchStatus::OK()) && !$status->equals(Enums\SearchStatus::ZERO_RESULTS())) {
            throw new Exceptions\QueryException($status, $this->query);
        }
    }
1197537
protected function updateStatus( $post, $status ) {

		// Update Post Status
		$this->modelService->updateStatus( $post, $status );

		return $this->checkStatus( $post );
	}
567048
public static function createIncorrectStatus($status, \Exception $e = null)
    {
        $message = 'Expected server status to be "OK", got "%s" instead';

        return new static(sprintf($message, $status), null, $e);
    }