namespace Google\Site_Kit_Dependencies\GuzzleHttp\Psr7; use Google\Site_Kit_Dependencies\Psr\Http\Message\MessageInterface; use Google\Site_Kit_Dependencies\Psr\Http\Message\RequestInterface; use Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface; use Google\Site_Kit_Dependencies\Psr\Http\Message\UriInterface; /** * Returns the string representation of an HTTP message. * * @param MessageInterface $message Message to convert to a string. * * @return string * * @deprecated str will be removed in guzzlehttp/psr7:2.0. Use Message::toString instead. */ function str(\Google\Site_Kit_Dependencies\Psr\Http\Message\MessageInterface $message) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::toString($message); } /** * Returns a UriInterface for the given value. * * This function accepts a string or UriInterface and returns a * UriInterface for the given value. If the value is already a * UriInterface, it is returned as-is. * * @param string|UriInterface $uri * * @return UriInterface * * @throws \InvalidArgumentException * * @deprecated uri_for will be removed in guzzlehttp/psr7:2.0. Use Utils::uriFor instead. */ function uri_for($uri) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::uriFor($uri); } /** * Create a new stream based on the input type. * * Options is an associative array that can contain the following keys: * - metadata: Array of custom metadata. * - size: Size of the stream. * * This method accepts the following `$resource` types: * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. * - `string`: Creates a stream object that uses the given string as the contents. * - `resource`: Creates a stream object that wraps the given PHP stream resource. * - `Iterator`: If the provided value implements `Iterator`, then a read-only * stream object will be created that wraps the given iterable. Each time the * stream is read from, data from the iterator will fill a buffer and will be * continuously called until the buffer is equal to the requested read size. * Subsequent read calls will first read from the buffer and then call `next` * on the underlying iterator until it is exhausted. * - `object` with `__toString()`: If the object has the `__toString()` method, * the object will be cast to a string and then a stream will be returned that * uses the string value. * - `NULL`: When `null` is passed, an empty stream object is returned. * - `callable` When a callable is passed, a read-only stream object will be * created that invokes the given callable. The callable is invoked with the * number of suggested bytes to read. The callable can return any number of * bytes, but MUST return `false` when there is no more data to return. The * stream object that wraps the callable will invoke the callable until the * number of requested bytes are available. Any additional bytes will be * buffered and used in subsequent reads. * * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data * @param array $options Additional options * * @return StreamInterface * * @throws \InvalidArgumentException if the $resource arg is not valid. * * @deprecated stream_for will be removed in guzzlehttp/psr7:2.0. Use Utils::streamFor instead. */ function stream_for($resource = '', array $options = []) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::streamFor($resource, $options); } /** * Parse an array of header values containing ";" separated data into an * array of associative arrays representing the header key value pair data * of the header. When a parameter does not contain a value, but just * contains a key, this function will inject a key with a '' string value. * * @param string|array $header Header to parse into components. * * @return array Returns the parsed header values. * * @deprecated parse_header will be removed in guzzlehttp/psr7:2.0. Use Header::parse instead. */ function parse_header($header) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Header::parse($header); } /** * Converts an array of header values that may contain comma separated * headers into an array of headers with no comma separated values. * * @param string|array $header Header to normalize. * * @return array Returns the normalized header field values. * * @deprecated normalize_header will be removed in guzzlehttp/psr7:2.0. Use Header::normalize instead. */ function normalize_header($header) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Header::normalize($header); } /** * Clone and modify a request with the given changes. * * This method is useful for reducing the number of clones needed to mutate a * message. * * The changes can be one of: * - method: (string) Changes the HTTP method. * - set_headers: (array) Sets the given headers. * - remove_headers: (array) Remove the given headers. * - body: (mixed) Sets the given body. * - uri: (UriInterface) Set the URI. * - query: (string) Set the query string value of the URI. * - version: (string) Set the protocol version. * * @param RequestInterface $request Request to clone and modify. * @param array $changes Changes to apply. * * @return RequestInterface * * @deprecated modify_request will be removed in guzzlehttp/psr7:2.0. Use Utils::modifyRequest instead. */ function modify_request(\Google\Site_Kit_Dependencies\Psr\Http\Message\RequestInterface $request, array $changes) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::modifyRequest($request, $changes); } /** * Attempts to rewind a message body and throws an exception on failure. * * The body of the message will only be rewound if a call to `tell()` returns a * value other than `0`. * * @param MessageInterface $message Message to rewind * * @throws \RuntimeException * * @deprecated rewind_body will be removed in guzzlehttp/psr7:2.0. Use Message::rewindBody instead. */ function rewind_body(\Google\Site_Kit_Dependencies\Psr\Http\Message\MessageInterface $message) { \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::rewindBody($message); } /** * Safely opens a PHP stream resource using a filename. * * When fopen fails, PHP normally raises a warning. This function adds an * error handler that checks for errors and throws an exception instead. * * @param string $filename File to open * @param string $mode Mode used to open the file * * @return resource * * @throws \RuntimeException if the file cannot be opened * * @deprecated try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead. */ function try_fopen($filename, $mode) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::tryFopen($filename, $mode); } /** * Copy the contents of a stream into a string until the given number of * bytes have been read. * * @param StreamInterface $stream Stream to read * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. * * @return string * * @throws \RuntimeException on error. * * @deprecated copy_to_string will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToString instead. */ function copy_to_string(\Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface $stream, $maxLen = -1) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::copyToString($stream, $maxLen); } /** * Copy the contents of a stream into another stream until the given number * of bytes have been read. * * @param StreamInterface $source Stream to read from * @param StreamInterface $dest Stream to write to * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. * * @throws \RuntimeException on error. * * @deprecated copy_to_stream will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToStream instead. */ function copy_to_stream(\Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface $source, \Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface $dest, $maxLen = -1) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::copyToStream($source, $dest, $maxLen); } /** * Calculate a hash of a stream. * * This method reads the entire stream to calculate a rolling hash, based on * PHP's `hash_init` functions. * * @param StreamInterface $stream Stream to calculate the hash for * @param string $algo Hash algorithm (e.g. md5, crc32, etc) * @param bool $rawOutput Whether or not to use raw output * * @return string Returns the hash of the stream * * @throws \RuntimeException on error. * * @deprecated hash will be removed in guzzlehttp/psr7:2.0. Use Utils::hash instead. */ function hash(\Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface $stream, $algo, $rawOutput = \false) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::hash($stream, $algo, $rawOutput); } /** * Read a line from the stream up to the maximum allowed buffer length. * * @param StreamInterface $stream Stream to read from * @param int|null $maxLength Maximum buffer length * * @return string * * @deprecated readline will be removed in guzzlehttp/psr7:2.0. Use Utils::readLine instead. */ function readline(\Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface $stream, $maxLength = null) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::readLine($stream, $maxLength); } /** * Parses a request message string into a request object. * * @param string $message Request message string. * * @return Request * * @deprecated parse_request will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequest instead. */ function parse_request($message) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::parseRequest($message); } /** * Parses a response message string into a response object. * * @param string $message Response message string. * * @return Response * * @deprecated parse_response will be removed in guzzlehttp/psr7:2.0. Use Message::parseResponse instead. */ function parse_response($message) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::parseResponse($message); } /** * Parse a query string into an associative array. * * If multiple values are found for the same key, the value of that key value * pair will become an array. This function does not parse nested PHP style * arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed * into `['foo[a]' => '1', 'foo[b]' => '2'])`. * * @param string $str Query string to parse * @param int|bool $urlEncoding How the query string is encoded * * @return array * * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. */ function parse_query($str, $urlEncoding = \true) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Query::parse($str, $urlEncoding); } /** * Build a query string from an array of key value pairs. * * This function can use the return value of `parse_query()` to build a query * string. This function does not modify the provided keys when an array is * encountered (like `http_build_query()` would). * * @param array $params Query string parameters. * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 * to encode using RFC3986, or PHP_QUERY_RFC1738 * to encode using RFC1738. * * @return string * * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. */ function build_query(array $params, $encoding = \PHP_QUERY_RFC3986) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Query::build($params, $encoding); } /** * Determines the mimetype of a file by looking at its extension. * * @param string $filename * * @return string|null * * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. */ function mimetype_from_filename($filename) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\MimeType::fromFilename($filename); } /** * Maps a file extensions to a mimetype. * * @param $extension string The file extension. * * @return string|null * * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. */ function mimetype_from_extension($extension) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\MimeType::fromExtension($extension); } /** * Parses an HTTP message into an associative array. * * The array contains the "start-line" key containing the start line of * the message, "headers" key containing an associative array of header * array values, and a "body" key containing the body of the message. * * @param string $message HTTP request or response to parse. * * @return array * * @internal * * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. */ function _parse_message($message) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::parseMessage($message); } /** * Constructs a URI for an HTTP request message. * * @param string $path Path from the start-line * @param array $headers Array of headers (each value an array). * * @return string * * @internal * * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. */ function _parse_request_uri($path, array $headers) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::parseRequestUri($path, $headers); } /** * Get a short summary of the message body. * * Will return `null` if the response is not printable. * * @param MessageInterface $message The message to get the body summary * @param int $truncateAt The maximum allowed size of the summary * * @return string|null * * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. */ function get_message_body_summary(\Google\Site_Kit_Dependencies\Psr\Http\Message\MessageInterface $message, $truncateAt = 120) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Message::bodySummary($message, $truncateAt); } /** * Remove the items given by the keys, case insensitively from the data. * * @param iterable $keys * * @return array * * @internal * * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. */ function _caseless_remove($keys, array $data) { return \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Utils::caselessRemove($keys, $data); }namespace Google\Site_Kit_Dependencies\GuzzleHttp; use Google\Site_Kit_Dependencies\GuzzleHttp\Handler\CurlHandler; use Google\Site_Kit_Dependencies\GuzzleHttp\Handler\CurlMultiHandler; use Google\Site_Kit_Dependencies\GuzzleHttp\Handler\Proxy; use Google\Site_Kit_Dependencies\GuzzleHttp\Handler\StreamHandler; /** * Expands a URI template * * @param string $template URI template * @param array $variables Template variables * * @return string */ function uri_template($template, array $variables) { if (\extension_loaded('uri_template')) { // @codeCoverageIgnoreStart return \Google\Site_Kit_Dependencies\uri_template($template, $variables); // @codeCoverageIgnoreEnd } static $uriTemplate; if (!$uriTemplate) { $uriTemplate = new \Google\Site_Kit_Dependencies\GuzzleHttp\UriTemplate(); } return $uriTemplate->expand($template, $variables); } /** * Debug function used to describe the provided value type and class. * * @param mixed $input * * @return string Returns a string containing the type of the variable and * if a class is provided, the class name. */ function describe_type($input) { switch (\gettype($input)) { case 'object': return 'object(' . \get_class($input) . ')'; case 'array': return 'array(' . \count($input) . ')'; default: \ob_start(); \var_dump($input); // normalize float vs double return \str_replace('double(', 'float(', \rtrim(\ob_get_clean())); } } /** * Parses an array of header lines into an associative array of headers. * * @param iterable $lines Header lines array of strings in the following * format: "Name: Value" * @return array */ function headers_from_lines($lines) { $headers = []; foreach ($lines as $line) { $parts = \explode(':', $line, 2); $headers[\trim($parts[0])][] = isset($parts[1]) ? \trim($parts[1]) : null; } return $headers; } /** * Returns a debug stream based on the provided variable. * * @param mixed $value Optional value * * @return resource */ function debug_resource($value = null) { if (\is_resource($value)) { return $value; } elseif (\defined('STDOUT')) { return \STDOUT; } return \fopen('php://output', 'w'); } /** * Chooses and creates a default handler to use based on the environment. * * The returned handler is not wrapped by any default middlewares. * * @return callable Returns the best handler for the given system. * @throws \RuntimeException if no viable Handler is available. */ function choose_handler() { $handler = null; if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) { $handler = \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\Proxy::wrapSync(new \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\CurlMultiHandler(), new \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\CurlHandler()); } elseif (\function_exists('curl_exec')) { $handler = new \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\CurlHandler(); } elseif (\function_exists('curl_multi_exec')) { $handler = new \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\CurlMultiHandler(); } if (\ini_get('allow_url_fopen')) { $handler = $handler ? \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\Proxy::wrapStreaming($handler, new \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\StreamHandler()) : new \Google\Site_Kit_Dependencies\GuzzleHttp\Handler\StreamHandler(); } elseif (!$handler) { throw new \RuntimeException('GuzzleHttp requires cURL, the ' . 'allow_url_fopen ini setting, or a custom HTTP handler.'); } return $handler; } /** * Get the default User-Agent string to use with Guzzle * * @return string */ function default_user_agent() { static $defaultAgent = ''; if (!$defaultAgent) { $defaultAgent = 'GuzzleHttp/' . \Google\Site_Kit_Dependencies\GuzzleHttp\Client::VERSION; if (\extension_loaded('curl') && \function_exists('curl_version')) { $defaultAgent .= ' curl/' . \curl_version()['version']; } $defaultAgent .= ' PHP/' . \PHP_VERSION; } return $defaultAgent; } /** * Returns the default cacert bundle for the current system. * * First, the openssl.cafile and curl.cainfo php.ini settings are checked. * If those settings are not configured, then the common locations for * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X * and Windows are checked. If any of these file locations are found on * disk, they will be utilized. * * Note: the result of this function is cached for subsequent calls. * * @return string * @throws \RuntimeException if no bundle can be found. */ function default_ca_bundle() { static $cached = null; static $cafiles = [ // Red Hat, CentOS, Fedora (provided by the ca-certificates package) '/etc/pki/tls/certs/ca-bundle.crt', // Ubuntu, Debian (provided by the ca-certificates package) '/etc/ssl/certs/ca-certificates.crt', // FreeBSD (provided by the ca_root_nss package) '/usr/local/share/certs/ca-root-nss.crt', // SLES 12 (provided by the ca-certificates package) '/var/lib/ca-certificates/ca-bundle.pem', // OS X provided by homebrew (using the default path) '/usr/local/etc/openssl/cert.pem', // Google app engine '/etc/ca-certificates.crt', // Windows? 'C:\\windows\\system32\\curl-ca-bundle.crt', 'C:\\windows\\curl-ca-bundle.crt', ]; if ($cached) { return $cached; } if ($ca = \ini_get('openssl.cafile')) { return $cached = $ca; } if ($ca = \ini_get('curl.cainfo')) { return $cached = $ca; } foreach ($cafiles as $filename) { if (\file_exists($filename)) { return $cached = $filename; } } throw new \RuntimeException(<<get_demo_content(); if ( ! empty( $demo_data ) && isset( $demo_data[ $index ] ) ) { return $demo_data[ $index ]; } return ''; } endif; if ( ! function_exists( 'astra_sites_get_reset_form_data' ) ) : /** * Get all the forms to be reset. * * @since 3.0.3 * @return array */ function astra_sites_get_reset_form_data() { global $wpdb; $form_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_astra_sites_imported_wp_forms'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- We need this to get all the WP forms. Traditional WP_Query would have been expensive here. return $form_ids; } endif; if ( ! function_exists( 'astra_sites_get_reset_term_data' ) ) : /** * Get all the terms to be reset. * * @since 3.0.3 * @return array */ function astra_sites_get_reset_term_data() { global $wpdb; $term_ids = $wpdb->get_col( "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='_astra_sites_imported_term'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- We need this to get all the terms and taxonomy. Traditional WP_Query would have been expensive here. return $term_ids; } endif; if ( ! function_exists( 'astra_sites_empty_post_excerpt' ) ) : /** * Remove the post excerpt * * @param int $post_id The post ID. * @since 3.1.0 */ function astra_sites_empty_post_excerpt( $post_id = 0 ) { if ( ! $post_id ) { return; } wp_update_post( array( 'ID' => $post_id, 'post_excerpt' => '', ) ); } endif;declare (strict_types=1); namespace ElementorProDeps\DI; use ElementorProDeps\DI\Definition\ArrayDefinitionExtension; use ElementorProDeps\DI\Definition\EnvironmentVariableDefinition; use ElementorProDeps\DI\Definition\Helper\AutowireDefinitionHelper; use ElementorProDeps\DI\Definition\Helper\CreateDefinitionHelper; use ElementorProDeps\DI\Definition\Helper\FactoryDefinitionHelper; use ElementorProDeps\DI\Definition\Reference; use ElementorProDeps\DI\Definition\StringDefinition; use ElementorProDeps\DI\Definition\ValueDefinition; if (!\function_exists('ElementorProDeps\\DI\\value')) { /** * Helper for defining a value. * * @param mixed $value */ function value($value) : ValueDefinition { return new ValueDefinition($value); } } if (!\function_exists('ElementorProDeps\\DI\\create')) { /** * Helper for defining an object. * * @param string|null $className Class name of the object. * If null, the name of the entry (in the container) will be used as class name. */ function create(string $className = null) : CreateDefinitionHelper { return new CreateDefinitionHelper($className); } } if (!\function_exists('ElementorProDeps\\DI\\autowire')) { /** * Helper for autowiring an object. * * @param string|null $className Class name of the object. * If null, the name of the entry (in the container) will be used as class name. */ function autowire(string $className = null) : AutowireDefinitionHelper { return new AutowireDefinitionHelper($className); } } if (!\function_exists('ElementorProDeps\\DI\\factory')) { /** * Helper for defining a container entry using a factory function/callable. * * @param callable $factory The factory is a callable that takes the container as parameter * and returns the value to register in the container. */ function factory($factory) : FactoryDefinitionHelper { return new FactoryDefinitionHelper($factory); } } if (!\function_exists('ElementorProDeps\\DI\\decorate')) { /** * Decorate the previous definition using a callable. * * Example: * * 'foo' => decorate(function ($foo, $container) { * return new CachedFoo($foo, $container->get('cache')); * }) * * @param callable $callable The callable takes the decorated object as first parameter and * the container as second. */ function decorate($callable) : FactoryDefinitionHelper { return new FactoryDefinitionHelper($callable, \true); } } if (!\function_exists('ElementorProDeps\\DI\\get')) { /** * Helper for referencing another container entry in an object definition. */ function get(string $entryName) : Reference { return new Reference($entryName); } } if (!\function_exists('ElementorProDeps\\DI\\env')) { /** * Helper for referencing environment variables. * * @param string $variableName The name of the environment variable. * @param mixed $defaultValue The default value to be used if the environment variable is not defined. */ function env(string $variableName, $defaultValue = null) : EnvironmentVariableDefinition { // Only mark as optional if the default value was *explicitly* provided. $isOptional = 2 === \func_num_args(); return new EnvironmentVariableDefinition($variableName, $isOptional, $defaultValue); } } if (!\function_exists('ElementorProDeps\\DI\\add')) { /** * Helper for extending another definition. * * Example: * * 'log.backends' => DI\add(DI\get('My\Custom\LogBackend')) * * or: * * 'log.backends' => DI\add([ * DI\get('My\Custom\LogBackend') * ]) * * @param mixed|array $values A value or an array of values to add to the array. * * @since 5.0 */ function add($values) : ArrayDefinitionExtension { if (!\is_array($values)) { $values = [$values]; } return new ArrayDefinitionExtension($values); } } if (!\function_exists('ElementorProDeps\\DI\\string')) { /** * Helper for concatenating strings. * * Example: * * 'log.filename' => DI\string('{app.path}/app.log') * * @param string $expression A string expression. Use the `{}` placeholders to reference other container entries. * * @since 5.0 */ function string(string $expression) : StringDefinition { return new StringDefinition($expression); } }/** * EnrollUserToCourse. * php version 5.6 * * @category EnrollUserToCourse * @package SureTriggers * @author BSF * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ use SureTriggers\Integrations\AutomateAction; use SureTriggers\Traits\SingletonLoader; use STM_LMS\STM_LMS_Mails; /** * EnrollUserToCourse * * @category EnrollUserToCourse * @package SureTriggers * @author BSF * @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3 * @link https://www.brainstormforce.com/ * @since 1.0.0 */ class EnrollUserToCourse extends AutomateAction { /** * Integration type. * * @var string */ public $integration = 'MasterStudyLms'; /** * Action name. * * @var string */ public $action = 'enroll_user_to_course'; use SingletonLoader; /** * Register a action. * * @param array $actions actions. * @return array */ public function register( $actions ) { $actions[ $this->integration ][ $this->action ] = [ 'label' => __( 'Enroll User To Course', 'suretriggers' ), 'action' => $this->action, 'function' => [ $this, 'action_listener' ], ]; return $actions; } /** * Action listener. * * @param int $user_id user_id. * @param int $automation_id automation_id. * @param array $fields fields. * @param array $selected_options selectedOptions. * @psalm-suppress UndefinedMethod * @throws Exception Exception. * * @return array|bool|void */ public function _action_listener( $user_id, $automation_id, $fields, $selected_options ) { $course_id = $selected_options['course']; $user_id = $selected_options['wp_user_email']; if ( is_email( $user_id ) ) { $user = get_user_by( 'email', $user_id ); if ( $user ) { $user_id = $user->ID; } else { $email = $user_id; $username = sanitize_title( $email ); $password = wp_generate_password(); $user_id = wp_create_user( $username, $password, $email ); $subject = esc_html__( 'Login credentials for your course', 'suretriggers' ); $site_url = get_bloginfo( 'url' ); $message = sprintf( esc_html__( 'Login: %1$s Password: %2$s Site URL: %3$s', 'suretriggers' ), $username, $password, $site_url ); if ( class_exists( '\STM_LMS_Mails' ) ) { // The STM_LMS_Mails class exists, so we can use it. \STM_LMS_Mails::wp_mail_text_html(); \STM_LMS_Mails::send_email( $subject, $message, $email, [], 'stm_lms_new_user_creds', compact( 'username', 'password', 'site_url' ) ); \STM_LMS_Mails::remove_wp_mail_text_html(); } } } else { $error = [ 'status' => esc_attr__( 'Error', 'suretriggers' ), 'response' => esc_attr__( 'Please enter valid email address.', 'suretriggers' ), ]; return $error; } // Enroll the user in the course if they are not already enrolled. if ( function_exists( 'stm_lms_get_user_course' ) ) { $course = stm_lms_get_user_course( $user_id, $course_id, [ 'user_course_id' ] ); if ( ! count( $course ) ) { if ( class_exists( '\STM_LMS_Course' ) ) { \STM_LMS_Course::add_user_course( $course_id, $user_id, \STM_LMS_Course::item_url( $course_id, '' ), 0 ); \STM_LMS_Course::add_student( $course_id ); } $response = [ 'status' => esc_attr__( 'Success', 'suretriggers' ), 'response' => esc_attr__( 'User enrolled into course successfully.', 'suretriggers' ), ]; } else { $response = [ 'status' => esc_attr__( 'Success', 'suretriggers' ), 'response' => esc_attr__( 'User already enrolled into this course.', 'suretriggers' ), ]; } return $response; } } } EnrollUserToCourse::get_instance();/** * Content Background - Dynamic CSS * * @package astra * @since 3.7.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } add_filter( 'astra_dynamic_theme_css', 'astra_content_background_css', 11 ); /** * Content Background - Dynamic CSS * * @param string $dynamic_css Astra Dynamic CSS. * @return String Generated dynamic CSS for content background. * * @since 3.2.0 */ function astra_content_background_css( $dynamic_css ) { if ( ! astra_has_gcp_typo_preset_compatibility() ) { return $dynamic_css; } $content_bg_obj = astra_get_option( 'content-bg-obj-responsive' ); // Override content background with meta value if set. $meta_background_enabled = astra_get_option_meta( 'ast-page-background-enabled' ); // Check for third party pages meta. if ( '' === $meta_background_enabled && astra_with_third_party() ) { $meta_background_enabled = astra_third_party_archive_meta( 'ast-page-background-enabled' ); if ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) { $content_bg_obj = astra_third_party_archive_meta( 'ast-content-background-meta' ); } } elseif ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) { $content_bg_obj = astra_get_option_meta( 'ast-content-background-meta' ); } $blog_layout = astra_get_blog_layout(); $blog_grid = astra_get_option( 'blog-grid' ); $sidebar_default_css = $content_bg_obj; $is_boxed = astra_is_content_style_boxed(); $is_sidebar_boxed = astra_is_sidebar_style_boxed(); $current_layout = astra_get_content_layout(); $narrow_dynamic_selector = 'narrow-width-container' === $current_layout && $is_boxed ? ', .ast-narrow-container .site-content' : ''; $comments_wrapper_bg_selector = Astra_Dynamic_CSS::astra_4_6_0_compatibility() ? ', .ast-separate-container .comments-area' : ', .ast-separate-container .comments-area .comment-respond, .ast-separate-container .comments-area .ast-comment-list li, .ast-separate-container .comments-area .comments-title'; $author_box_extra_selector = ( true === astra_check_is_structural_setup() ) ? '.site-main' : ''; // Apply unboxed container with sidebar boxed look by changing background color to site background color. $content_bg_obj = astra_apply_unboxed_container( $content_bg_obj, $is_boxed, $is_sidebar_boxed, $current_layout ); // Container Layout Colors. $container_css = array( '.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector . $comments_wrapper_bg_selector => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); // Container Layout Colors. $container_css_tablet = array( '.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); // Container Layout Colors. $container_css_mobile = array( '.ast-separate-container .ast-article-single:not(.ast-related-post), .woocommerce.ast-separate-container .ast-woocommerce-container, .ast-separate-container .error-404, .ast-separate-container .no-results, .single.ast-separate-container ' . esc_attr( $author_box_extra_selector ) . ' .ast-author-meta, .ast-separate-container .related-posts-title-wrapper,.ast-separate-container .comments-count-wrapper, .ast-box-layout.ast-plain-container .site-content,.ast-padded-layout.ast-plain-container .site-content, .ast-separate-container .ast-archive-description' . $narrow_dynamic_selector => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); // Sidebar specific css. $sidebar_css = array( '.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'desktop' ), ); // Sidebar specific css. $sidebar_css_tablet = array( '.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'tablet' ), ); // Sidebar specific css. $sidebar_css_mobile = array( '.ast-separate-container.ast-two-container #secondary .widget' => astra_get_responsive_background_obj( $sidebar_default_css, 'mobile' ), ); // Apply Content BG Color for Narrow Unboxed Container. if ( ! astra_is_content_style_boxed() && 'narrow-container' === $current_layout ) { $container_css = array_merge( $container_css, array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ) ) ); $container_css_tablet = array_merge( $container_css_tablet, array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ) ) ); $container_css_mobile = array_merge( $container_css_mobile, array( '.ast-narrow-container .site-content' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ) ) ); } // Blog Pro Layout Colors. if ( ( 'blog-layout-1' === $blog_layout || 'blog-layout-4' === $blog_layout || 'blog-layout-6' === $blog_layout ) || ( defined( 'ASTRA_EXT_VER' ) && ( 'blog-layout-1' === $blog_layout || 'blog-layout-4' === $blog_layout || 'blog-layout-6' === $blog_layout ) && 1 !== $blog_grid ) ) { $blog_layouts = array( '.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); $blog_layouts_tablet = array( '.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); $blog_layouts_mobile = array( '.ast-separate-container .ast-article-inner' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); } else { $blog_layouts = array( '.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); $blog_layouts_tablet = array( '.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); $blog_layouts_mobile = array( '.ast-separate-container .ast-article-post' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); $inner_layout = array( '.ast-separate-container .ast-article-inner' => array( 'background-color' => 'transparent', 'background-image' => 'none', ), ); $dynamic_css .= astra_parse_css( $inner_layout ); } $dynamic_css .= astra_parse_css( $blog_layouts ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $blog_layouts_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $blog_layouts_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= astra_parse_css( $container_css ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $container_css_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $container_css_mobile, '', astra_get_mobile_breakpoint() ); $dynamic_css .= astra_parse_css( $sidebar_css ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $sidebar_css_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $sidebar_css_mobile, '', astra_get_mobile_breakpoint() ); if ( astra_apply_content_background_fullwidth_layouts() ) { $fullwidth_layout = array( '.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'desktop' ), ); $fullwidth_layout_tablet = array( '.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'tablet' ), ); $fullwidth_layout_mobile = array( '.ast-plain-container, .ast-page-builder-template' => astra_get_responsive_background_obj( $content_bg_obj, 'mobile' ), ); $dynamic_css .= astra_parse_css( $fullwidth_layout ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $fullwidth_layout_tablet, '', astra_get_tablet_breakpoint() ); /** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $dynamic_css .= astra_parse_css( $fullwidth_layout_mobile, '', astra_get_mobile_breakpoint() ); } return $dynamic_css; } /** * Applies an unboxed container to the content. * * @since 4.2.0 * @param array $content_bg_obj The background object for the content. * @param bool $is_boxed Container style is boxed or not. * @param bool $is_sidebar_boxed Sidebar style is boxed or not. * @param mixed $current_layout The current container layout applied. * @return array $content_bg_obj The updated background object for the content. */ function astra_apply_unboxed_container( $content_bg_obj, $is_boxed, $is_sidebar_boxed, $current_layout ) { $site_bg_obj = astra_get_option( 'site-layout-outside-bg-obj-responsive' ); $meta_background_enabled = astra_get_option_meta( 'ast-page-background-enabled' ); // Check for third party pages meta. if ( '' === $meta_background_enabled && astra_with_third_party() ) { $meta_background_enabled = astra_third_party_archive_meta( 'ast-page-background-enabled' ); if ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) { $site_bg_obj = astra_third_party_archive_meta( 'ast-page-background-meta' ); } } elseif ( isset( $meta_background_enabled ) && 'enabled' === $meta_background_enabled ) { $site_bg_obj = astra_get_option_meta( 'ast-page-background-meta' ); } if ( 'plain-container' === $current_layout && ! $is_boxed && $is_sidebar_boxed && 'no-sidebar' !== astra_page_layout() ) { $content_bg_obj = $site_bg_obj; } return $content_bg_obj; }/** * Admin functions - Functions that add some functionality to WordPress admin panel * * @package Astra * @since 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Register menus */ if ( ! function_exists( 'astra_register_menu_locations' ) ) { /** * Register menus * * @since 1.0.0 */ function astra_register_menu_locations() { /** * Primary Menus */ register_nav_menus( array( 'primary' => esc_html__( 'Primary Menu', 'astra' ), ) ); if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { /** * Register the Secondary & Mobile menus. */ register_nav_menus( array( 'secondary_menu' => esc_html__( 'Secondary Menu', 'astra' ), 'mobile_menu' => esc_html__( 'Off-Canvas Menu', 'astra' ), ) ); $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu; for ( $index = 3; $index <= $component_limit; $index++ ) { if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'menu-' . $index ) ) { continue; } register_nav_menus( array( 'menu_' . $index => esc_html__( 'Menu ', 'astra' ) . $index, ) ); } /** * Register the Account menus. */ register_nav_menus( array( 'loggedin_account_menu' => esc_html__( 'Logged In Account Menu', 'astra' ), ) ); } /** * Footer Menus */ register_nav_menus( array( 'footer_menu' => esc_html__( 'Footer Menu', 'astra' ), ) ); } } add_action( 'init', 'astra_register_menu_locations' );/** * Schema markup. * * @package Astra * @author Astra * @copyright Copyright (c) 2020, Astra * @link https://wpastra.com/ * @since Astra 2.1.3 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Astra CreativeWork Schema Markup. * * @since 2.1.3 */ class Astra_WPHeader_Schema extends Astra_Schema { /** * Setup schema * * @since 2.1.3 */ public function setup_schema() { if ( true !== $this->schema_enabled() ) { return false; } add_filter( 'astra_attr_header', array( $this, 'wpheader_Schema' ) ); } /** * Update Schema markup attribute. * * @param array $attr An array of attributes. * * @return array Updated embed markup. */ public function wpheader_Schema( $attr ) { $attr['itemtype'] = 'https://schema.org/WPHeader'; $attr['itemscope'] = 'itemscope'; $attr['itemid'] = '#masthead'; return $attr; } /** * Enabled schema * * @since 2.1.3 */ protected function schema_enabled() { return apply_filters( 'astra_wpheader_schema_enabled', parent::schema_enabled() ); } } new Astra_WPHeader_Schema();/** * Transparent Header - Customizer. * * @package Astra * @since 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! class_exists( 'Astra_Ext_Transparent_Header_Loader' ) ) { /** * Customizer Initialization * * @since 1.0.0 */ class Astra_Ext_Transparent_Header_Loader { /** * Member Variable * * @var object instance */ private static $instance; /** * Initiator */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor */ public function __construct() { add_filter( 'astra_theme_defaults', array( $this, 'theme_defaults' ) ); add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) ); add_action( 'customize_register', array( $this, 'customize_register' ), 2 ); } /** * Set Options Default Values * * @param array $defaults Astra options default value array. * @return array */ public function theme_defaults( $defaults ) { // Header - Transparent. $defaults['transparent-header-logo'] = ''; $defaults['transparent-header-retina-logo'] = ''; $defaults['different-transparent-logo'] = 0; $defaults['different-transparent-retina-logo'] = 0; $defaults['transparent-header-logo-width'] = array( 'desktop' => 150, 'tablet' => 120, 'mobile' => 100, ); $defaults['transparent-header-enable'] = 0; /** * Old option for 404, search and archive pages. * * For default value on separate option this setting is in use. */ $defaults['transparent-header-disable-archive'] = 1; $defaults['transparent-header-disable-latest-posts-index'] = 1; $defaults['transparent-header-on-devices'] = 'both'; $defaults['transparent-header-main-sep'] = ''; $defaults['transparent-header-main-sep-color'] = ''; /** * Transparent Header */ $defaults['transparent-header-bg-color'] = ''; $defaults['transparent-header-color-site-title'] = ''; $defaults['transparent-header-color-h-site-title'] = ''; $defaults['transparent-menu-bg-color'] = ''; $defaults['transparent-menu-color'] = ''; $defaults['transparent-menu-h-color'] = ''; $defaults['transparent-submenu-bg-color'] = ''; $defaults['transparent-submenu-color'] = ''; $defaults['transparent-submenu-h-color'] = ''; $defaults['transparent-header-logo-color'] = ''; /** * Transparent Header Responsive Colors */ $defaults['transparent-header-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['hba-transparent-header-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['hbb-transparent-header-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-header-color-site-title-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-header-color-h-site-title-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-menu-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-menu-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-menu-h-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-submenu-bg-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-submenu-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-submenu-h-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-content-section-text-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-content-section-link-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); $defaults['transparent-content-section-link-h-color-responsive'] = array( 'desktop' => '', 'tablet' => '', 'mobile' => '', ); return $defaults; } /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ public function customize_register( $wp_customize ) { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound /** * Register Panel & Sections */ require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/class-astra-transparent-header-panels-and-sections.php'; /** * Sections */ require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-colors-transparent-header-configs.php'; // Check Transparent Header is activated. require_once ASTRA_THEME_TRANSPARENT_HEADER_DIR . 'classes/sections/class-astra-customizer-transparent-header-configs.php'; // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } /** * Customizer Preview */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; wp_enqueue_script( 'astra-transparent-header-customizer-preview-js', ASTRA_THEME_TRANSPARENT_HEADER_URI . 'assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for further JS. wp_localize_script( 'astra-transparent-header-customizer-preview-js', 'AstraBuilderTransparentData', array( 'is_astra_hf_builder_active' => Astra_Builder_Helper::$is_header_footer_builder_active, 'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(), 'transparent_header_devices' => astra_get_option( 'transparent-header-on-devices' ), ) ); } } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Ext_Transparent_Header_Loader::get_instance();/** * Astra Theme Customizer Configuration Builder. * * @package astra-builder * @author Astra * @copyright Copyright (c) 2020, Astra * @link https://wpastra.com/ * @since 3.0.0 */ // No direct access, please. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Register Builder Customizer Configurations. * * @since 3.0.0 */ class Astra_Button_Component_Configs { /** * Register Builder Customizer Configurations. * * @param array $configurations Configurations. * @param string $builder_type Builder Type. * @param string $section Section. * * @since 3.0.0 * @return array $configurations Astra Customizer Configurations with updated configurations. */ public static function register_configuration( $configurations, $builder_type = 'header', $section = 'section-hb-button-' ) { if ( 'footer' === $builder_type ) { $class_obj = Astra_Builder_Footer::get_instance(); $number_of_button = Astra_Builder_Helper::$num_of_footer_button; $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_button; } else { $class_obj = Astra_Builder_Header::get_instance(); $number_of_button = Astra_Builder_Helper::$num_of_header_button; $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_button; } $button_config = array(); for ( $index = 1; $index <= $component_limit; $index++ ) { $_section = $section . $index; $_prefix = 'button' . $index; /** * These options are related to Header Section - Button. * Prefix hs represents - Header Section. */ $button_config[] = array( /* * Header Builder section - Button Component Configs. */ array( 'name' => $_section, 'type' => 'section', 'priority' => 50, /* translators: %s Index */ 'title' => ( 1 === $number_of_button ) ? __( 'Button', 'astra' ) : sprintf( __( 'Button %s', 'astra' ), $index ), 'panel' => 'panel-' . $builder_type . '-builder-group', 'clone_index' => $index, 'clone_type' => $builder_type . '-button', ), /** * Option: Header Builder Tabs */ array( 'name' => $_section . '-ast-context-tabs', 'section' => $_section, 'type' => 'control', 'control' => 'ast-builder-header-control', 'priority' => 0, 'description' => '', ), /** * Option: Button Text */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text' ), 'type' => 'control', 'control' => 'text', 'section' => $_section, 'priority' => 20, 'title' => __( 'Text', 'astra' ), 'transport' => 'postMessage', 'partial' => array( 'selector' => '.ast-' . $builder_type . '-button-' . $index, 'container_inclusive' => false, 'render_callback' => array( $class_obj, 'button_' . $index ), 'fallback_refresh' => false, ), 'context' => Astra_Builder_Helper::$general_tab, ), /** * Option: Button Link */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-link-option]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-link-option' ), 'type' => 'control', 'control' => 'ast-link', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_link' ), 'section' => $_section, 'priority' => 30, 'title' => __( 'Link', 'astra' ), 'transport' => 'postMessage', 'partial' => array( 'selector' => '.ast-' . $builder_type . '-button-' . $index, 'container_inclusive' => false, 'render_callback' => array( $class_obj, 'button_' . $index ), ), 'context' => Astra_Builder_Helper::$general_tab, 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), ), /** * Group: Primary Header Button Colors Group */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-color-group]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-color-group' ), 'type' => 'control', 'control' => 'ast-color-group', 'title' => __( 'Text Color', 'astra' ), 'section' => $_section, 'transport' => 'postMessage', 'priority' => 70, 'context' => Astra_Builder_Helper::$design_tab, 'responsive' => true, 'divider' => array( 'ast_class' => 'ast-section-spacing' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-background-color-group]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-color-group' ), 'type' => 'control', 'control' => 'ast-color-group', 'title' => __( 'Background Color', 'astra' ), 'section' => $_section, 'transport' => 'postMessage', 'priority' => 70, 'context' => Astra_Builder_Helper::$design_tab, 'responsive' => true, ), /** * Option: Button Text Color */ array( 'name' => $builder_type . '-' . $_prefix . '-text-color', 'transport' => 'postMessage', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text-color' ), 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-color-group]', 'section' => $_section, 'tab' => __( 'Normal', 'astra' ), 'control' => 'ast-responsive-color', 'responsive' => true, 'rgba' => true, 'priority' => 9, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Normal', 'astra' ), ), /** * Option: Button Text Hover Color */ array( 'name' => $builder_type . '-' . $_prefix . '-text-h-color', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text-h-color' ), 'transport' => 'postMessage', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-color-group]', 'section' => $_section, 'tab' => __( 'Hover', 'astra' ), 'control' => 'ast-responsive-color', 'responsive' => true, 'rgba' => true, 'priority' => 9, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Hover', 'astra' ), ), /** * Option: Button Background Color */ array( 'name' => $builder_type . '-' . $_prefix . '-back-color', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-back-color' ), 'transport' => 'postMessage', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-background-color-group]', 'section' => $_section, 'tab' => __( 'Normal', 'astra' ), 'control' => 'ast-responsive-color', 'responsive' => true, 'rgba' => true, 'priority' => 10, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Normal', 'astra' ), ), /** * Option: Button Button Hover Color */ array( 'name' => $builder_type . '-' . $_prefix . '-back-h-color', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-back-h-color' ), 'transport' => 'postMessage', 'type' => 'sub-control', 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-background-color-group]', 'section' => $_section, 'tab' => __( 'Hover', 'astra' ), 'control' => 'ast-responsive-color', 'responsive' => true, 'rgba' => true, 'priority' => 10, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Hover', 'astra' ), ), array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-builder-button-border-colors-group]', 'type' => 'control', 'control' => 'ast-color-group', 'title' => __( 'Border Color', 'astra' ), 'section' => $_section, 'priority' => 70, 'transport' => 'postMessage', 'context' => Astra_Builder_Helper::$design_tab, 'responsive' => true, 'divider' => array( 'ast_class' => 'ast-bottom-divider' ), ), /** * Option: Button Border Color */ array( 'name' => $builder_type . '-' . $_prefix . '-border-color', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-color' ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-builder-button-border-colors-group]', 'transport' => 'postMessage', 'type' => 'sub-control', 'section' => $_section, 'control' => 'ast-responsive-color', 'responsive' => true, 'rgba' => true, 'priority' => 70, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Normal', 'astra' ), ), /** * Option: Button Border Hover Color */ array( 'name' => $builder_type . '-' . $_prefix . '-border-h-color', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-h-color' ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-builder-button-border-colors-group]', 'transport' => 'postMessage', 'type' => 'sub-control', 'section' => $_section, 'control' => 'ast-responsive-color', 'responsive' => true, 'rgba' => true, 'priority' => 70, 'context' => Astra_Builder_Helper::$design_tab, 'title' => __( 'Hover', 'astra' ), ), /** * Option: Button Border Size */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-border-size]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-size' ), 'type' => 'control', 'section' => $_section, 'control' => 'ast-border', 'transport' => 'postMessage', 'linked_choices' => true, 'priority' => 99, 'title' => __( 'Border Width', 'astra' ), 'context' => Astra_Builder_Helper::$design_tab, 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), ), /** * Option: Button Radius Fields */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-border-radius-fields]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-radius-fields' ), 'type' => 'control', 'control' => 'ast-responsive-spacing', 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ), 'section' => $_section, 'title' => __( 'Border Radius', 'astra' ), 'linked_choices' => true, 'transport' => 'postMessage', 'unit_choices' => array( 'px', 'em', '%' ), 'choices' => array( 'top' => __( 'Top', 'astra' ), 'right' => __( 'Right', 'astra' ), 'bottom' => __( 'Bottom', 'astra' ), 'left' => __( 'Left', 'astra' ), ), 'priority' => 99, 'context' => Astra_Builder_Helper::$design_tab, 'connected' => false, 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), ), /** * Option: Primary Header Button Typography */ array( 'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text-typography' ), 'type' => 'control', 'control' => 'ast-settings-group', 'title' => __( 'Font', 'astra' ), 'section' => $_section, 'transport' => 'postMessage', 'context' => Astra_Builder_Helper::$design_tab, 'priority' => 90, ), /** * Option: Primary Header Button Font Family */ array( 'name' => $builder_type . '-' . $_prefix . '-font-family', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-font-family' ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]', 'type' => 'sub-control', 'section' => $_section, 'control' => 'ast-font', 'font_type' => 'ast-font-family', 'title' => __( 'Font Family', 'astra' ), 'context' => Astra_Builder_Helper::$general_tab, 'connect' => $builder_type . '-' . $_prefix . '-font-weight', 'priority' => 1, 'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ), ), /** * Option: Primary Footer Button Font Weight */ array( 'name' => $builder_type . '-' . $_prefix . '-font-weight', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-font-weight' ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]', 'type' => 'sub-control', 'section' => $_section, 'control' => 'ast-font', 'font_type' => 'ast-font-weight', 'title' => __( 'Font Weight', 'astra' ), 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ), 'connect' => $builder_type . '-' . $_prefix . '-font-family', 'priority' => 2, 'context' => Astra_Builder_Helper::$general_tab, 'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ), ), /** * Option: Primary Header Button Font Size */ array( 'name' => $builder_type . '-' . $_prefix . '-font-size', 'default' => astra_get_option( $builder_type . '-' . $_prefix . '-font-size' ), 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]', 'transport' => 'postMessage', 'title' => __( 'Font Size', 'astra' ), 'type' => 'sub-control', 'section' => $_section, 'control' => 'ast-responsive-slider', 'priority' => 3, 'context' => Astra_Builder_Helper::$general_tab, 'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ), 'suffix' => array( 'px', 'em', 'vw', 'rem' ), 'input_attrs' => array( 'px' => array( 'min' => 0, 'step' => 1, 'max' => 200, ), 'em' => array( 'min' => 0, 'step' => 0.01, 'max' => 20, ), 'vw' => array( 'min' => 0, 'step' => 0.1, 'max' => 25, ), 'rem' => array( 'min' => 0, 'step' => 0.1, 'max' => 20, ), ), ), /** * Option: Primary Footer Button Font Extras */ array( 'name' => $builder_type . '-' . $_prefix . '-font-extras', 'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]', 'section' => $_section, 'type' => 'sub-control', 'control' => 'ast-font-extras', 'priority' => 5, 'default' => astra_get_option( 'breadcrumb-font-extras' ), 'context' => Astra_Builder_Helper::$general_tab, 'title' => __( 'Font Extras', 'astra' ), ), ); if ( 'footer' === $builder_type ) { $button_config[] = array( array( 'name' => ASTRA_THEME_SETTINGS . '[footer-button-' . $index . '-alignment]', 'default' => astra_get_option( 'footer-button-' . $index . '-alignment' ), 'type' => 'control', 'control' => 'ast-selector', 'section' => $_section, 'priority' => 35, 'title' => __( 'Alignment', 'astra' ), 'context' => Astra_Builder_Helper::$general_tab, 'transport' => 'postMessage', 'choices' => array( 'flex-start' => 'align-left', 'center' => 'align-center', 'flex-end' => 'align-right', ), 'divider' => array( 'ast_class' => 'ast-top-section-divider' ), ), ); } $button_config[] = Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, $builder_type ); $button_config[] = Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ); } $button_config = call_user_func_array( 'array_merge', $button_config + array( array() ) ); $configurations = array_merge( $configurations, $button_config ); return $configurations; } } /** * Kicking this off by creating object of this class. */ new Astra_Button_Component_Configs();/** * Off Canvas. * * @package astra-builder * @author Brainstorm Force * @copyright Copyright (c) 2020, Brainstorm Force * @link https://www.brainstormforce.com * @since 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_OFF_CANVAS_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/off-canvas' ); define( 'ASTRA_OFF_CANVAS_URI', ASTRA_THEME_URI . 'inc/builder/type/header/off-canvas' ); /** * Off Canvas Initial Setup * * @since 3.0.0 */ class Astra_Off_Canvas { /** * Constructor function that initializes required actions and hooks. */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_OFF_CANVAS_DIR . '/class-astra-off-canvas-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_OFF_CANVAS_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Off_Canvas();/** * WIDGET component. * * @package Astra Builder * @author Brainstorm Force * @copyright Copyright (c) 2020, Brainstorm Force * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ASTRA_BUILDER_HEADER_WIDGET_DIR', ASTRA_THEME_DIR . 'inc/builder/type/header/widget' ); define( 'ASTRA_BUILDER_HEADER_WIDGET_URI', ASTRA_THEME_URI . 'inc/builder/type/header/widget' ); /** * Heading Initial Setup * * @since 3.0.0 */ class Astra_Header_Widget_Component { /** * Constructor function that initializes required actions and hooks */ public function __construct() { // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound require_once ASTRA_BUILDER_HEADER_WIDGET_DIR . '/class-astra-header-widget-component-loader.php'; // Include front end files. if ( ! is_admin() || Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) { require_once ASTRA_BUILDER_HEADER_WIDGET_DIR . '/dynamic-css/dynamic.css.php'; } // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound } } /** * Kicking this off by creating an object. */ new Astra_Header_Widget_Component();/** * Mobile Navigation Menu Styling Loader for Astra theme. * * @package Astra Builder * @author Brainstorm Force * @copyright Copyright (c) 2020, Brainstorm Force * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Mobile Navigation Menu Initialization * * @since 3.0.0 */ class Astra_Mobile_Menu_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; wp_enqueue_script( 'astra-mobile-menu-customizer-preview', ASTRA_BUILDER_MOBILE_MENU_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Mobile_Menu_Component_Loader();/** * WIDGET Styling Loader for Astra theme. * * @package Astra Builder * @author Brainstorm Force * @copyright Copyright (c) 2020, Brainstorm Force * @link https://www.brainstormforce.com * @since Astra 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Customizer Initialization * * @since 3.0.0 */ class Astra_Footer_Widget_Component_Loader { /** * Constructor * * @since 3.0.0 */ public function __construct() { add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); } /** * Customizer Preview * * @since 3.0.0 */ public function preview_scripts() { /** * Load unminified if SCRIPT_DEBUG is true. */ /* Directory and Extension */ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; wp_enqueue_script( 'astra-footer-widget-customizer-preview-js', ASTRA_BUILDER_FOOTER_WIDGET_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); // Localize variables for WIDGET JS. wp_localize_script( 'astra-footer-widget-customizer-preview-js', 'AstraBuilderWidgetData', array( 'footer_widget_count' => defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_widgets, 'tablet_break_point' => astra_get_tablet_breakpoint(), 'mobile_break_point' => astra_get_mobile_breakpoint(), 'is_flex_based_css' => Astra_Builder_Helper::apply_flex_based_css(), 'has_block_editor' => astra_has_widgets_block_editor(), ) ); } } /** * Kicking this off by creating the object of the class. */ new Astra_Footer_Widget_Component_Loader(); https://azaanmoversandpakers.com/post-sitemap1.xml 2025-06-18T18:50:28+00:00 https://azaanmoversandpakers.com/post-sitemap2.xml 2025-06-18T18:00:13+00:00 https://azaanmoversandpakers.com/post-sitemap3.xml 2025-06-18T16:43:06+00:00 https://azaanmoversandpakers.com/post-sitemap4.xml 2025-06-18T15:40:05+00:00 https://azaanmoversandpakers.com/page-sitemap.xml 2025-06-11T19:36:51+00:00 https://azaanmoversandpakers.com/category-sitemap1.xml 2025-06-18T18:50:28+00:00 https://azaanmoversandpakers.com/category-sitemap2.xml 2025-06-18T18:00:13+00:00