urn $pattern; } /** * Prepare a raw block pattern before it gets output in a REST API response. * * @since 6.0.0 * @since 6.3.0 Added `source` property. * * @param array $item Raw pattern as registered, before any changes. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $keys = array( 'name' => 'name', 'title' => 'title', 'content' => 'content', 'description' => 'description', 'viewportWidth' => 'viewport_width', 'inserter' => 'inserter', 'categories' => 'categories', 'keywords' => 'keywords', 'blockTypes' => 'block_types', 'postTypes' => 'post_types', 'templateTypes' => 'template_types', 'source' => 'source', ); $data = array(); foreach ( $keys as $item_key => $rest_key ) { if ( isset( $item[ $item_key ] ) && rest_is_field_included( $rest_key, $fields ) ) { $data[ $rest_key ] = $item[ $item_key ]; } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); return rest_ensure_response( $data ); } /** * Retrieves the block pattern schema, conforming to JSON Schema. * * @since 6.0.0 * @since 6.3.0 Added `source` property. * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'block-pattern', 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The pattern name.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'title' => array( 'description' => __( 'The pattern title, in human readable format.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'content' => array( 'description' => __( 'The pattern content.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'description' => array( 'description' => __( 'The pattern detailed description.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'viewport_width' => array( 'description' => __( 'The pattern viewport width for inserter preview.' ), 'type' => 'number', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'inserter' => array( 'description' => __( 'Determines whether the pattern is visible in inserter.' ), 'type' => 'boolean', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'categories' => array( 'description' => __( 'The pattern category slugs.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'keywords' => array( 'description' => __( 'The pattern keywords.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'block_types' => array( 'description' => __( 'Block types that the pattern is intended to be used with.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'post_types' => array( 'description' => __( 'An array of post types that the pattern is restricted to be used with.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'template_types' => array( 'description' => __( 'An array of template types where the pattern fits.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'source' => array( 'description' => __( 'Where the pattern comes from e.g. core' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), 'enum' => array( 'core', 'plugin', 'theme', 'pattern-directory/core', 'pattern-directory/theme', 'pattern-directory/featured', ), ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } } int * * The Content-Transfer-Encoding. * One of ENC7BIT (default), ENC8BIT, * ENCBINARY, ENCBASE64, * ENCQUOTEDPRINTABLE or ENCOTHER. * * * * charset * string * The charset parameter of the MIME type. * * * type.parameters * array * An associative array of Content-Type parameter names and their values. * * * subtype * string * The MIME subtype, e.g. 'jpeg' for TYPEIMAGE. * * * id * string * The Content-ID. * * * description * string * The Content-Description. * * * disposition.type * string * The Content-Disposition, e.g. 'attachment'. * * * disposition * array * An associative array of Content-Disposition parameter names and values. * * * contents.data * string * The payload. * * * lines * int * The size of the payload in lines. * * * bytes * int * The size of the payload in bytes. * * * md5 * string * The MD5 checksum of the payload. * * * * * @return string Returns the MIME message as string. * @throws ImapException * */ function imap_mail_compose(array $envelope, array $body): string { error_clear_last(); $result = \imap_mail_compose($envelope, $body); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Copies mail messages specified by msglist * to specified mailbox. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $msglist msglist is a range not just message * numbers (as described in RFC2060). * @param string $mailbox The mailbox name, see imap_open for more * information * @param int $options options is a bitmask of one or more of * * * * CP_UID - the sequence numbers contain UIDS * * * * * CP_MOVE - Delete the messages from * the current mailbox after copying * * * * @throws ImapException * */ function imap_mail_copy($imap_stream, string $msglist, string $mailbox, int $options = 0): void { error_clear_last(); $result = \imap_mail_copy($imap_stream, $msglist, $mailbox, $options); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Moves mail messages specified by msglist to the * specified mailbox. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $msglist msglist is a range not just message numbers * (as described in RFC2060). * @param string $mailbox The mailbox name, see imap_open for more * information * @param int $options options is a bitmask and may contain the single option: * * * * CP_UID - the sequence numbers contain UIDS * * * * @throws ImapException * */ function imap_mail_move($imap_stream, string $msglist, string $mailbox, int $options = 0): void { error_clear_last(); $result = \imap_mail_move($imap_stream, $msglist, $mailbox, $options); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * This function allows sending of emails with correct handling of * Cc and Bcc receivers. * * The parameters to, cc * and bcc are all strings and are all parsed * as RFC822 address lists. * * @param string $to The receiver * @param string $subject The mail subject * @param string $message The mail body, see imap_mail_compose * @param string $additional_headers As string with additional headers to be set on the mail * @param string $cc * @param string $bcc The receivers specified in bcc will get the * mail, but are excluded from the headers. * @param string $rpath Use this parameter to specify return path upon mail delivery failure. * This is useful when using PHP as a mail client for multiple users. * @throws ImapException * */ function imap_mail(string $to, string $subject, string $message, string $additional_headers = null, string $cc = null, string $bcc = null, string $rpath = null): void { error_clear_last(); $result = \imap_mail($to, $subject, $message, $additional_headers, $cc, $bcc, $rpath); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Checks the current mailbox status on the server. It is similar to * imap_status, but will additionally sum up the size of * all messages in the mailbox, which will take some additional time to * execute. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @return \stdClass Returns the information in an object with following properties: * * Mailbox properties * * * * Date * date of last change (current datetime) * * * Driver * driver * * * Mailbox * name of the mailbox * * * Nmsgs * number of messages * * * Recent * number of recent messages * * * Unread * number of unread messages * * * Deleted * number of deleted messages * * * Size * mailbox size * * * * * * Returns FALSE on failure. * @throws ImapException * */ function imap_mailboxmsginfo($imap_stream): \stdClass { error_clear_last(); $result = \imap_mailboxmsginfo($imap_stream); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Decode a modified UTF-7 (as specified in RFC 2060, section 5.1.3) string to UTF-8. * * @param string $in A string encoded in modified UTF-7. * @return string Returns in converted to UTF-8. * @throws ImapException * */ function imap_mutf7_to_utf8(string $in): string { error_clear_last(); $result = \imap_mutf7_to_utf8($in); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Gets the number of messages in the current mailbox. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @return int Return the number of messages in the current mailbox, as an integer. * @throws ImapException * */ function imap_num_msg($imap_stream): int { error_clear_last(); $result = \imap_num_msg($imap_stream); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Opens an IMAP stream to a mailbox. * * This function can also be used to open streams to POP3 and * NNTP servers, but some functions and features are only * available on IMAP servers. * * @param string $mailbox A mailbox name consists of a server and a mailbox path on this server. * The special name INBOX stands for the current users * personal mailbox. Mailbox names that contain international characters * besides those in the printable ASCII space have to be encoded with * imap_utf7_encode. * * The server part, which is enclosed in '{' and '}', consists of the servers * name or ip address, an optional port (prefixed by ':'), and an optional * protocol specification (prefixed by '/'). * * The server part is mandatory in all mailbox * parameters. * * All names which start with { are remote names, and are * in the form "{" remote_system_name [":" port] [flags] "}" * [mailbox_name] where: * * * * remote_system_name - Internet domain name or * bracketed IP address of server. * * * * * port - optional TCP port number, default is the * default port for that service * * * * * flags - optional flags, see following table. * * * * * mailbox_name - remote mailbox name, default is INBOX * * * * * * Optional flags for names * * * * Flag * Description * * * * * /service=service * mailbox access service, default is "imap" * * * /user=user * remote user name for login on the server * * * /authuser=user * remote authentication user; if specified this is the user name * whose password is used (e.g. administrator) * * * /anonymous * remote access as anonymous user * * * /debug * record protocol telemetry in application's debug log * * * /secure * do not transmit a plaintext password over the network * * * /imap, /imap2, * /imap2bis, /imap4, * /imap4rev1 * equivalent to /service=imap * * * /pop3 * equivalent to /service=pop3 * * * /nntp * equivalent to /service=nntp * * * /norsh * do not use rsh or ssh to establish a preauthenticated IMAP * session * * * /ssl * use the Secure Socket Layer to encrypt the session * * * /validate-cert * validate certificates from TLS/SSL server (this is the default * behavior) * * * /novalidate-cert * do not validate certificates from TLS/SSL server, needed if * server uses self-signed certificates * * * /tls * force use of start-TLS to encrypt the session, and reject * connection to servers that do not support it * * * /notls * do not do start-TLS to encrypt the session, even with servers * that support it * * * /readonly * request read-only mailbox open (IMAP only; ignored on NNTP, and * an error with SMTP and POP3) * * * * * @param string $username The user name * @param string $password The password associated with the username * @param int $options The options are a bit mask with one or more of * the following: * * * * OP_READONLY - Open mailbox read-only * * * * * OP_ANONYMOUS - Don't use or update a * .newsrc for news (NNTP only) * * * * * OP_HALFOPEN - For IMAP * and NNTP names, open a connection but * don't open a mailbox. * * * * * CL_EXPUNGE - Expunge mailbox automatically upon mailbox close * (see also imap_delete and * imap_expunge) * * * * * OP_DEBUG - Debug protocol negotiations * * * * * OP_SHORTCACHE - Short (elt-only) caching * * * * * OP_SILENT - Don't pass up events (internal use) * * * * * OP_PROTOTYPE - Return driver prototype * * * * * OP_SECURE - Don't do non-secure authentication * * * * @param int $n_retries Number of maximum connect attempts * @param array|null $params Connection parameters, the following (string) keys maybe used * to set one or more connection parameters: * * * * DISABLE_AUTHENTICATOR - Disable authentication properties * * * * @return resource Returns an IMAP stream on success. * @throws ImapException * */ function imap_open(string $mailbox, string $username, string $password, int $options = 0, int $n_retries = 0, ?array $params = null) { error_clear_last(); $result = \imap_open($mailbox, $username, $password, $options, $n_retries, $params); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * This function renames on old mailbox to new mailbox (see * imap_open for the format of * mbox names). * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $old_mbox The old mailbox name, see imap_open for more * information * @param string $new_mbox The new mailbox name, see imap_open for more * information * @throws ImapException * */ function imap_renamemailbox($imap_stream, string $old_mbox, string $new_mbox): void { error_clear_last(); $result = \imap_renamemailbox($imap_stream, $old_mbox, $new_mbox); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Saves a part or the whole body of the specified message. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string|resource $file The path to the saved file as a string, or a valid file descriptor * returned by fopen. * @param int $msg_number The message number * @param string $part_number The part number. It is a string of integers delimited by period which * index into a body part list as per the IMAP4 specification * @param int $options A bitmask with one or more of the following: * * * * FT_UID - The msg_number is a UID * * * * * FT_PEEK - Do not set the \Seen flag if * not already set * * * * * FT_INTERNAL - The return string is in * internal format, will not canonicalize to CRLF. * * * * @throws ImapException * */ function imap_savebody($imap_stream, $file, int $msg_number, string $part_number = "", int $options = 0): void { error_clear_last(); $result = \imap_savebody($imap_stream, $file, $msg_number, $part_number, $options); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Sets an upper limit quota on a per mailbox basis. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $quota_root The mailbox to have a quota set. This should follow the IMAP standard * format for a mailbox: user.name. * @param int $quota_limit The maximum size (in KB) for the quota_root * @throws ImapException * */ function imap_set_quota($imap_stream, string $quota_root, int $quota_limit): void { error_clear_last(); $result = \imap_set_quota($imap_stream, $quota_root, $quota_limit); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Sets the ACL for a giving mailbox. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $mailbox The mailbox name, see imap_open for more * information * @param string $id The user to give the rights to. * @param string $rights The rights to give to the user. Passing an empty string will delete * acl. * @throws ImapException * */ function imap_setacl($imap_stream, string $mailbox, string $id, string $rights): void { error_clear_last(); $result = \imap_setacl($imap_stream, $mailbox, $id, $rights); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Causes a store to add the specified flag to the * flags set for the messages in the specified * sequence. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $sequence A sequence of message numbers. You can enumerate desired messages * with the X,Y syntax, or retrieve all messages * within an interval with the X:Y syntax * @param string $flag The flags which you can set are \Seen, * \Answered, \Flagged, * \Deleted, and \Draft as * defined by RFC2060. * @param int $options A bit mask that may contain the single option: * * * * ST_UID - The sequence argument contains UIDs * instead of sequence numbers * * * * @throws ImapException * */ function imap_setflag_full($imap_stream, string $sequence, string $flag, int $options = NIL): void { error_clear_last(); $result = \imap_setflag_full($imap_stream, $sequence, $flag, $options); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Gets and sorts message numbers by the given parameters. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param int $criteria Criteria can be one (and only one) of the following: * * * * SORTDATE - message Date * * * * * SORTARRIVAL - arrival date * * * * * SORTFROM - mailbox in first From address * * * * * SORTSUBJECT - message subject * * * * * SORTTO - mailbox in first To address * * * * * SORTCC - mailbox in first cc address * * * * * SORTSIZE - size of message in octets * * * * @param int $reverse Set this to 1 for reverse sorting * @param int $options The options are a bitmask of one or more of the * following: * * * * SE_UID - Return UIDs instead of sequence numbers * * * * * SE_NOPREFETCH - Don't prefetch searched messages * * * * @param string $search_criteria IMAP2-format search criteria string. For details see * imap_search. * @param string $charset MIME character set to use when sorting strings. * @return array Returns an array of message numbers sorted by the given * parameters. * @throws ImapException * */ function imap_sort($imap_stream, int $criteria, int $reverse, int $options = 0, string $search_criteria = null, string $charset = null): array { error_clear_last(); $result = \imap_sort($imap_stream, $criteria, $reverse, $options, $search_criteria, $charset); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Subscribe to a new mailbox. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $mailbox The mailbox name, see imap_open for more * information * @throws ImapException * */ function imap_subscribe($imap_stream, string $mailbox): void { error_clear_last(); $result = \imap_subscribe($imap_stream, $mailbox); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Gets a tree of a threaded message. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param int $options * @return array imap_thread returns an associative array containing * a tree of messages threaded by REFERENCES. * * Every message in the current mailbox will be represented by three entries * in the resulting array: * * * $thread["XX.num"] - current message number * * * $thread["XX.next"] * * * $thread["XX.branch"] * * * @throws ImapException * */ function imap_thread($imap_stream, int $options = SE_FREE): array { error_clear_last(); $result = \imap_thread($imap_stream, $options); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Sets or fetches the imap timeout. * * @param int $timeout_type One of the following: * IMAP_OPENTIMEOUT, * IMAP_READTIMEOUT, * IMAP_WRITETIMEOUT, or * IMAP_CLOSETIMEOUT. * @param int $timeout The timeout, in seconds. * @return mixed If the timeout parameter is set, this function * returns TRUE on success. * * If timeout is not provided or evaluates to -1, * the current timeout value of timeout_type is * returned as an integer. * @throws ImapException * */ function imap_timeout(int $timeout_type, int $timeout = -1) { error_clear_last(); $result = \imap_timeout($timeout_type, $timeout); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; } /** * Removes the deletion flag for a specified message, which is set by * imap_delete or imap_mail_move. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param int $msg_number The message number * @param int $flags * @throws ImapException * */ function imap_undelete($imap_stream, int $msg_number, int $flags = 0): void { error_clear_last(); $result = \imap_undelete($imap_stream, $msg_number, $flags); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Unsubscribe from the specified mailbox. * * @param resource $imap_stream An IMAP stream returned by * imap_open. * @param string $mailbox The mailbox name, see imap_open for more * information * @throws ImapException * */ function imap_unsubscribe($imap_stream, string $mailbox): void { error_clear_last(); $result = \imap_unsubscribe($imap_stream, $mailbox); if ($result === false) { throw ImapException::createFromPhpError(); } } /** * Encode a UTF-8 string to modified UTF-7 (as specified in RFC 2060, section 5.1.3). * * @param string $in A UTF-8 encoded string. * @return string Returns in converted to modified UTF-7. * @throws ImapException * */ function imap_utf8_to_mutf7(string $in): string { error_clear_last(); $result = \imap_utf8_to_mutf7($in); if ($result === false) { throw ImapException::createFromPhpError(); } return $result; }
Fatal error: require(): Failed opening required '/home/nimaghor/public_html/wp-content/plugins/woocommerce/vendor/composer/jetpack_autoload_classmap.php' (include_path='.:/opt/alt/php74/usr/share/pear') in /home/nimaghor/public_html/wp-content/plugins/woocommerce/vendor/jetpack-autoloader/class-autoloader-locator.php on line 83