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();/** * Astra Updates * * Functions for updating data, used by the background updater. * * @package Astra * @version 2.1.3 */ defined( 'ABSPATH' ) || exit; /** * Clear Astra + Astra Pro assets cache. * * @since 3.6.1 * @return void. */ function astra_clear_all_assets_cache() { if ( ! class_exists( 'Astra_Cache_Base' ) ) { return; } // Clear Astra theme asset cache. $astra_cache_base_instance = new Astra_Cache_Base( 'astra' ); $astra_cache_base_instance->refresh_assets( 'astra' ); // Clear Astra Addon's static and dynamic CSS asset cache. $astra_addon_cache_base_instance = new Astra_Cache_Base( 'astra-addon' ); $astra_addon_cache_base_instance->refresh_assets( 'astra-addon' ); } /** * 4.0.0 backward handling part. * * 1. Migrate existing setting & do required onboarding for new admin dashboard v4.0.0 app. * 2. Migrating Post Structure & Meta options in title area meta parts. * * @since 4.0.0 * @return void */ function astra_theme_background_updater_4_0_0() { // Dynamic customizer migration starts here. $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['dynamic-blog-layouts'] ) && ! isset( $theme_options['theme-dynamic-customizer-support'] ) ) { $theme_options['dynamic-blog-layouts'] = false; $theme_options['theme-dynamic-customizer-support'] = true; $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); // Archive summary box compatibility. $archive_title_font_size = array( 'desktop' => isset( $theme_options['font-size-archive-summary-title']['desktop'] ) ? $theme_options['font-size-archive-summary-title']['desktop'] : 40, 'tablet' => isset( $theme_options['font-size-archive-summary-title']['tablet'] ) ? $theme_options['font-size-archive-summary-title']['tablet'] : '', 'mobile' => isset( $theme_options['font-size-archive-summary-title']['mobile'] ) ? $theme_options['font-size-archive-summary-title']['mobile'] : '', 'desktop-unit' => isset( $theme_options['font-size-archive-summary-title']['desktop-unit'] ) ? $theme_options['font-size-archive-summary-title']['desktop-unit'] : 'px', 'tablet-unit' => isset( $theme_options['font-size-archive-summary-title']['tablet-unit'] ) ? $theme_options['font-size-archive-summary-title']['tablet-unit'] : 'px', 'mobile-unit' => isset( $theme_options['font-size-archive-summary-title']['mobile-unit'] ) ? $theme_options['font-size-archive-summary-title']['mobile-unit'] : 'px', ); $single_title_font_size = array( 'desktop' => isset( $theme_options['font-size-entry-title']['desktop'] ) ? $theme_options['font-size-entry-title']['desktop'] : '', 'tablet' => isset( $theme_options['font-size-entry-title']['tablet'] ) ? $theme_options['font-size-entry-title']['tablet'] : '', 'mobile' => isset( $theme_options['font-size-entry-title']['mobile'] ) ? $theme_options['font-size-entry-title']['mobile'] : '', 'desktop-unit' => isset( $theme_options['font-size-entry-title']['desktop-unit'] ) ? $theme_options['font-size-entry-title']['desktop-unit'] : 'px', 'tablet-unit' => isset( $theme_options['font-size-entry-title']['tablet-unit'] ) ? $theme_options['font-size-entry-title']['tablet-unit'] : 'px', 'mobile-unit' => isset( $theme_options['font-size-entry-title']['mobile-unit'] ) ? $theme_options['font-size-entry-title']['mobile-unit'] : 'px', ); $archive_summary_box_bg = array( 'desktop' => array( 'background-color' => ! empty( $theme_options['archive-summary-box-bg-color'] ) ? $theme_options['archive-summary-box-bg-color'] : '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'background-type' => '', 'background-media' => '', ), 'tablet' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'background-type' => '', 'background-media' => '', ), 'mobile' => array( 'background-color' => '', 'background-image' => '', 'background-repeat' => 'repeat', 'background-position' => 'center center', 'background-size' => 'auto', 'background-attachment' => 'scroll', 'background-type' => '', 'background-media' => '', ), ); // Single post structure. foreach ( $post_types as $index => $post_type ) { /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $single_post_structure = isset( $theme_options['blog-single-post-structure'] ) ? $theme_options['blog-single-post-structure'] : array( 'single-image', 'single-title-meta' ); /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $migrated_post_structure = array(); if ( ! empty( $single_post_structure ) ) { /** @psalm-suppress PossiblyInvalidIterator */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort foreach ( $single_post_structure as $key ) { /** @psalm-suppress PossiblyInvalidIterator */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( 'single-title-meta' === $key ) { $migrated_post_structure[] = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title'; if ( 'post' === $post_type ) { $migrated_post_structure[] = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-meta'; } } if ( 'single-image' === $key ) { $migrated_post_structure[] = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-image'; } } $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-structure' ] = $migrated_post_structure; } // Single post meta. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $single_post_meta = isset( $theme_options['blog-single-meta'] ) ? $theme_options['blog-single-meta'] : array( 'comments', 'category', 'author' ); /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $migrated_post_metadata = array(); if ( ! empty( $single_post_meta ) ) { $tax_counter = 0; $tax_slug = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-taxonomy'; /** @psalm-suppress PossiblyInvalidIterator */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort foreach ( $single_post_meta as $key ) { /** @psalm-suppress PossiblyInvalidIterator */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort switch ( $key ) { case 'author': $migrated_post_metadata[] = 'author'; break; case 'date': $migrated_post_metadata[] = 'date'; break; case 'comments': $migrated_post_metadata[] = 'comments'; break; case 'category': if ( 'post' === $post_type ) { $migrated_post_metadata[] = $tax_slug; $theme_options[ $tax_slug ] = 'category'; $tax_counter = ++$tax_counter; $tax_slug = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-taxonomy-' . $tax_counter; } break; case 'tag': if ( 'post' === $post_type ) { $migrated_post_metadata[] = $tax_slug; $theme_options[ $tax_slug ] = 'post_tag'; $tax_counter = ++$tax_counter; $tax_slug = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-taxonomy-' . $tax_counter; } break; default: break; } } $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-metadata' ] = $migrated_post_metadata; } // Archive layout compatibilities. $archive_banner_layout = ( class_exists( 'WooCommerce' ) && 'product' === $post_type ) ? false : true; // Setting WooCommerce archive option disabled as WC already added their header content on archive. $theme_options[ 'ast-archive-' . esc_attr( $post_type ) . '-title' ] = $archive_banner_layout; // Single layout compatibilities. $single_banner_layout = ( class_exists( 'WooCommerce' ) && 'product' === $post_type ) ? false : true; // Setting WC single option disabled as there is no any header set from default WooCommerce. $theme_options[ 'ast-single-' . esc_attr( $post_type ) . '-title' ] = $single_banner_layout; // BG color support. $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-banner-image-type' ] = ! empty( $theme_options['archive-summary-box-bg-color'] ) ? 'custom' : 'none'; $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-banner-custom-bg' ] = $archive_summary_box_bg; // Archive title font support. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-family' ] = ! empty( $theme_options['font-family-archive-summary-title'] ) ? $theme_options['font-family-archive-summary-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-size' ] = $archive_title_font_size; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-weight' ] = ! empty( $theme_options['font-weight-archive-summary-title'] ) ? $theme_options['font-weight-archive-summary-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $archive_dynamic_line_height = ! empty( $theme_options['line-height-archive-summary-title'] ) ? $theme_options['line-height-archive-summary-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $archive_dynamic_text_transform = ! empty( $theme_options['text-transform-archive-summary-title'] ) ? $theme_options['text-transform-archive-summary-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-title-font-extras' ] = array( 'line-height' => $archive_dynamic_line_height, 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => $archive_dynamic_text_transform, 'text-decoration' => '', ); // Archive title colors support. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-banner-title-color' ] = ! empty( $theme_options['archive-summary-box-title-color'] ) ? $theme_options['archive-summary-box-title-color'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-banner-text-color' ] = ! empty( $theme_options['archive-summary-box-text-color'] ) ? $theme_options['archive-summary-box-text-color'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort // Single title colors support. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-banner-title-color' ] = ! empty( $theme_options['entry-title-color'] ) ? $theme_options['entry-title-color'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort // Single title font support. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-family' ] = ! empty( $theme_options['font-family-entry-title'] ) ? $theme_options['font-family-entry-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-size' ] = $single_title_font_size; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-weight' ] = ! empty( $theme_options['font-weight-entry-title'] ) ? $theme_options['font-weight-entry-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $single_dynamic_line_height = ! empty( $theme_options['line-height-entry-title'] ) ? $theme_options['line-height-entry-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $single_dynamic_text_transform = ! empty( $theme_options['text-transform-entry-title'] ) ? $theme_options['text-transform-entry-title'] : ''; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-extras' ] = array( 'line-height' => $single_dynamic_line_height, 'line-height-unit' => 'em', 'letter-spacing' => '', 'letter-spacing-unit' => 'px', 'text-transform' => $single_dynamic_text_transform, 'text-decoration' => '', ); } // Set page specific structure, as page only has featured image at top & title beneath to it, hardcoded writing it here. $theme_options['ast-dynamic-single-page-structure'] = array( 'ast-dynamic-single-page-image', 'ast-dynamic-single-page-title' ); // EDD content layout & sidebar layout migration in new dynamic option. $theme_options['archive-download-content-layout'] = isset( $theme_options['edd-archive-product-layout'] ) ? $theme_options['edd-archive-product-layout'] : 'default'; $theme_options['archive-download-sidebar-layout'] = isset( $theme_options['edd-sidebar-layout'] ) ? $theme_options['edd-sidebar-layout'] : 'no-sidebar'; $theme_options['single-download-content-layout'] = isset( $theme_options['edd-single-product-layout'] ) ? $theme_options['edd-single-product-layout'] : 'default'; $theme_options['single-download-sidebar-layout'] = isset( $theme_options['edd-single-product-sidebar-layout'] ) ? $theme_options['edd-single-product-sidebar-layout'] : 'default'; update_option( 'astra-settings', $theme_options ); } // Admin backward handling starts here. $admin_dashboard_settings = get_option( 'astra_admin_settings', array() ); if ( ! isset( $admin_dashboard_settings['theme-setup-admin-migrated'] ) ) { if ( ! isset( $admin_dashboard_settings['self_hosted_gfonts'] ) ) { $admin_dashboard_settings['self_hosted_gfonts'] = isset( $theme_options['load-google-fonts-locally'] ) ? $theme_options['load-google-fonts-locally'] : false; } if ( ! isset( $admin_dashboard_settings['preload_local_fonts'] ) ) { $admin_dashboard_settings['preload_local_fonts'] = isset( $theme_options['preload-local-fonts'] ) ? $theme_options['preload-local-fonts'] : false; } // Consider admin part from theme side migrated. $admin_dashboard_settings['theme-setup-admin-migrated'] = true; update_option( 'astra_admin_settings', $admin_dashboard_settings ); } // Check if existing user and disable smooth scroll-to-id. if ( ! isset( $theme_options['enable-scroll-to-id'] ) ) { $theme_options['enable-scroll-to-id'] = false; update_option( 'astra-settings', $theme_options ); } // Check if existing user and disable scroll to top if disabled from pro addons list. $scroll_to_top_visibility = false; /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'scroll-to-top' ) ) { /** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $scroll_to_top_visibility = true; } if ( ! isset( $theme_options['scroll-to-top-enable'] ) ) { $theme_options['scroll-to-top-enable'] = $scroll_to_top_visibility; update_option( 'astra-settings', $theme_options ); } // Default colors & typography flag. if ( ! isset( $theme_options['update-default-color-typo'] ) ) { $theme_options['update-default-color-typo'] = false; update_option( 'astra-settings', $theme_options ); } // Block editor experience improvements compatibility flag. if ( ! isset( $theme_options['v4-block-editor-compat'] ) ) { $theme_options['v4-block-editor-compat'] = false; update_option( 'astra-settings', $theme_options ); } } /** * 4.0.2 backward handling part. * * 1. Read Time option backwards handling for old users. * * @since 4.0.2 * @return void */ function astra_theme_background_updater_4_0_2() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-0-2-update-migration'] ) && isset( $theme_options['blog-single-meta'] ) && in_array( 'read-time', $theme_options['blog-single-meta'] ) ) { if ( isset( $theme_options['ast-dynamic-single-post-metadata'] ) && ! in_array( 'read-time', $theme_options['ast-dynamic-single-post-metadata'] ) ) { $theme_options['ast-dynamic-single-post-metadata'][] = 'read-time'; $theme_options['v4-0-2-update-migration'] = true; update_option( 'astra-settings', $theme_options ); } } } /** * Handle backward compatibility on version 4.1.0 * * @since 4.1.0 * @return void */ function astra_theme_background_updater_4_1_0() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-1-0-update-migration'] ) ) { $theme_options['v4-1-0-update-migration'] = true; $current_payment_list = array(); $old_payment_list = isset( $theme_options['single-product-payment-list']['items'] ) ? $theme_options['single-product-payment-list']['items'] : array(); $visa_payment = isset( $theme_options['single-product-payment-visa'] ) ? $theme_options['single-product-payment-visa'] : ''; $mastercard_payment = isset( $theme_options['single-product-payment-mastercard'] ) ? $theme_options['single-product-payment-mastercard'] : ''; $discover_payment = isset( $theme_options['single-product-payment-discover'] ) ? $theme_options['single-product-payment-discover'] : ''; $paypal_payment = isset( $theme_options['single-product-payment-paypal'] ) ? $theme_options['single-product-payment-paypal'] : ''; $apple_pay_payment = isset( $theme_options['single-product-payment-apple-pay'] ) ? $theme_options['single-product-payment-apple-pay'] : ''; false !== $visa_payment ? array_push( $current_payment_list, array( 'id' => 'item-100', 'enabled' => true, 'source' => 'icon', 'icon' => 'cc-visa', 'image' => '', 'label' => __( 'Visa', 'astra' ), ) ) : ''; false !== $mastercard_payment ? array_push( $current_payment_list, array( 'id' => 'item-101', 'enabled' => true, 'source' => 'icon', 'icon' => 'cc-mastercard', 'image' => '', 'label' => __( 'Mastercard', 'astra' ), ) ) : ''; false !== $mastercard_payment ? array_push( $current_payment_list, array( 'id' => 'item-102', 'enabled' => true, 'source' => 'icon', 'icon' => 'cc-amex', 'image' => '', 'label' => __( 'Amex', 'astra' ), ) ) : ''; false !== $discover_payment ? array_push( $current_payment_list, array( 'id' => 'item-103', 'enabled' => true, 'source' => 'icon', 'icon' => 'cc-discover', 'image' => '', 'label' => __( 'Discover', 'astra' ), ) ) : ''; $paypal_payment ? array_push( $current_payment_list, array( 'id' => 'item-104', 'enabled' => true, 'source' => 'icon', 'icon' => 'cc-paypal', 'image' => '', 'label' => __( 'Paypal', 'astra' ), ) ) : ''; $apple_pay_payment ? array_push( $current_payment_list, array( 'id' => 'item-105', 'enabled' => true, 'source' => 'icon', 'icon' => 'cc-apple-pay', 'image' => '', 'label' => __( 'Apple Pay', 'astra' ), ) ) : ''; if ( $current_payment_list ) { $theme_options['single-product-payment-list'] = array( 'items' => array_merge( $current_payment_list, $old_payment_list ), ); update_option( 'astra-settings', $theme_options ); } if ( ! isset( $theme_options['woo_support_global_settings'] ) ) { $theme_options['woo_support_global_settings'] = true; update_option( 'astra-settings', $theme_options ); } if ( isset( $theme_options['theme-dynamic-customizer-support'] ) ) { $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); foreach ( $post_types as $index => $post_type ) { $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-title-font-extras' ]['text-transform'] = ''; } update_option( 'astra-settings', $theme_options ); } } } /** * 4.1.4 backward handling cases. * * 1. Migrating users to combined color overlay option to new dedicated overlay options. * * @since 4.1.4 * @return void */ function astra_theme_background_updater_4_1_4() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-1-4-update-migration'] ) ) { $ast_bg_control_options = array( 'off-canvas-background', 'footer-adv-bg-obj', 'footer-bg-obj', ); foreach ( $ast_bg_control_options as $key => $bg_option ) { if ( isset( $theme_options[ $bg_option ] ) && ! isset( $theme_options[ $bg_option ]['overlay-type'] ) ) { $bg_type = isset( $theme_options[ $bg_option ]['background-type'] ) ? $theme_options[ $bg_option ]['background-type'] : ''; $theme_options[ $bg_option ]['overlay-type'] = 'none'; $theme_options[ $bg_option ]['overlay-color'] = ''; $theme_options[ $bg_option ]['overlay-opacity'] = ''; $theme_options[ $bg_option ]['overlay-gradient'] = ''; if ( 'image' === $bg_type ) { $bg_img = isset( $theme_options[ $bg_option ]['background-image'] ) ? $theme_options[ $bg_option ]['background-image'] : ''; $bg_color = isset( $theme_options[ $bg_option ]['background-color'] ) ? $theme_options[ $bg_option ]['background-color'] : ''; if ( '' !== $bg_img && '' !== $bg_color && ( ! is_numeric( strpos( $bg_color, 'linear-gradient' ) ) && ! is_numeric( strpos( $bg_color, 'radial-gradient' ) ) ) ) { $theme_options[ $bg_option ]['overlay-type'] = 'classic'; $theme_options[ $bg_option ]['overlay-color'] = $bg_color; $theme_options[ $bg_option ]['overlay-opacity'] = ''; $theme_options[ $bg_option ]['overlay-gradient'] = ''; } } } } $ast_resp_bg_control_options = array( 'hba-footer-bg-obj-responsive', 'hbb-footer-bg-obj-responsive', 'footer-bg-obj-responsive', 'footer-menu-bg-obj-responsive', 'hb-footer-bg-obj-responsive', 'hba-header-bg-obj-responsive', 'hbb-header-bg-obj-responsive', 'hb-header-bg-obj-responsive', 'header-mobile-menu-bg-obj-responsive', 'site-layout-outside-bg-obj-responsive', 'content-bg-obj-responsive', ); $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); foreach ( $post_types as $index => $post_type ) { $ast_resp_bg_control_options[] = 'ast-dynamic-archive-' . esc_attr( $post_type ) . '-banner-custom-bg'; $ast_resp_bg_control_options[] = 'ast-dynamic-single-' . esc_attr( $post_type ) . '-banner-background'; } $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu; for ( $index = 1; $index <= $component_limit; $index++ ) { $_prefix = 'menu' . $index; $ast_resp_bg_control_options[] = 'header-' . $_prefix . '-bg-obj-responsive'; } foreach ( $ast_resp_bg_control_options as $key => $resp_bg_option ) { // Desktop version. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( isset( $theme_options[ $resp_bg_option ]['desktop'] ) && is_array( $theme_options[ $resp_bg_option ]['desktop'] ) && ! isset( $theme_options[ $resp_bg_option ]['desktop']['overlay-type'] ) ) { // @codingStandardsIgnoreStart $desk_bg_type = isset( $theme_options[ $resp_bg_option ]['desktop']['background-type'] ) ? $theme_options[ $resp_bg_option ]['desktop']['background-type'] : ''; // @codingStandardsIgnoreEnd $theme_options[ $resp_bg_option ]['desktop']['overlay-type'] = ''; $theme_options[ $resp_bg_option ]['desktop']['overlay-color'] = ''; $theme_options[ $resp_bg_option ]['desktop']['overlay-opacity'] = ''; $theme_options[ $resp_bg_option ]['desktop']['overlay-gradient'] = ''; if ( 'image' === $desk_bg_type ) { $bg_img = isset( $theme_options[ $resp_bg_option ]['desktop']['background-image'] ) ? $theme_options[ $resp_bg_option ]['desktop']['background-image'] : ''; $bg_color = isset( $theme_options[ $resp_bg_option ]['desktop']['background-color'] ) ? $theme_options[ $resp_bg_option ]['desktop']['background-color'] : ''; if ( '' !== $bg_img && '' !== $bg_color && ( ! is_numeric( strpos( $bg_color, 'linear-gradient' ) ) && ! is_numeric( strpos( $bg_color, 'radial-gradient' ) ) ) ) { $theme_options[ $resp_bg_option ]['desktop']['overlay-type'] = 'classic'; $theme_options[ $resp_bg_option ]['desktop']['overlay-color'] = $bg_color; $theme_options[ $resp_bg_option ]['desktop']['overlay-opacity'] = ''; $theme_options[ $resp_bg_option ]['desktop']['overlay-gradient'] = ''; } } } // Tablet version. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( isset( $theme_options[ $resp_bg_option ]['tablet'] ) && is_array( $theme_options[ $resp_bg_option ]['tablet'] ) && ! isset( $theme_options[ $resp_bg_option ]['tablet']['overlay-type'] ) ) { // @codingStandardsIgnoreStart $tablet_bg_type = isset( $theme_options[ $resp_bg_option ]['tablet']['background-type'] ) ? $theme_options[ $resp_bg_option ]['tablet']['background-type'] : ''; // @codingStandardsIgnoreEnd $theme_options[ $resp_bg_option ]['tablet']['overlay-type'] = ''; $theme_options[ $resp_bg_option ]['tablet']['overlay-color'] = ''; $theme_options[ $resp_bg_option ]['tablet']['overlay-opacity'] = ''; $theme_options[ $resp_bg_option ]['tablet']['overlay-gradient'] = ''; if ( 'image' === $tablet_bg_type ) { $bg_img = isset( $theme_options[ $resp_bg_option ]['tablet']['background-image'] ) ? $theme_options[ $resp_bg_option ]['tablet']['background-image'] : ''; $bg_color = isset( $theme_options[ $resp_bg_option ]['tablet']['background-color'] ) ? $theme_options[ $resp_bg_option ]['tablet']['background-color'] : ''; if ( '' !== $bg_img && '' !== $bg_color && ( ! is_numeric( strpos( $bg_color, 'linear-gradient' ) ) && ! is_numeric( strpos( $bg_color, 'radial-gradient' ) ) ) ) { $theme_options[ $resp_bg_option ]['tablet']['overlay-type'] = 'classic'; $theme_options[ $resp_bg_option ]['tablet']['overlay-color'] = $bg_color; $theme_options[ $resp_bg_option ]['tablet']['overlay-opacity'] = ''; $theme_options[ $resp_bg_option ]['tablet']['overlay-gradient'] = ''; } } } // Mobile version. /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( isset( $theme_options[ $resp_bg_option ]['mobile'] ) && is_array( $theme_options[ $resp_bg_option ]['mobile'] ) && ! isset( $theme_options[ $resp_bg_option ]['mobile']['overlay-type'] ) ) { // @codingStandardsIgnoreStart $mobile_bg_type = isset( $theme_options[ $resp_bg_option ]['mobile']['background-type'] ) ? $theme_options[ $resp_bg_option ]['mobile']['background-type'] : ''; // @codingStandardsIgnoreEnd $theme_options[ $resp_bg_option ]['mobile']['overlay-type'] = ''; $theme_options[ $resp_bg_option ]['mobile']['overlay-color'] = ''; $theme_options[ $resp_bg_option ]['mobile']['overlay-opacity'] = ''; $theme_options[ $resp_bg_option ]['mobile']['overlay-gradient'] = ''; if ( 'image' === $mobile_bg_type ) { $bg_img = isset( $theme_options[ $resp_bg_option ]['mobile']['background-image'] ) ? $theme_options[ $resp_bg_option ]['mobile']['background-image'] : ''; $bg_color = isset( $theme_options[ $resp_bg_option ]['mobile']['background-color'] ) ? $theme_options[ $resp_bg_option ]['mobile']['background-color'] : ''; if ( '' !== $bg_img && '' !== $bg_color && ( ! is_numeric( strpos( $bg_color, 'linear-gradient' ) ) && ! is_numeric( strpos( $bg_color, 'radial-gradient' ) ) ) ) { $theme_options[ $resp_bg_option ]['mobile']['overlay-type'] = 'classic'; $theme_options[ $resp_bg_option ]['mobile']['overlay-color'] = $bg_color; $theme_options[ $resp_bg_option ]['mobile']['overlay-opacity'] = ''; $theme_options[ $resp_bg_option ]['mobile']['overlay-gradient'] = ''; } } } } $theme_options['v4-1-4-update-migration'] = true; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility on version 4.1.6 * * @since 4.1.6 * @return void */ function astra_theme_background_updater_4_1_6() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['list-block-vertical-spacing'] ) ) { $theme_options['list-block-vertical-spacing'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Set flag to avoid direct reflections on live site & to maintain backward compatibility for existing users. * * @since 4.1.7 * @return void */ function astra_theme_background_updater_4_1_7() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['add-hr-styling-css'] ) ) { $theme_options['add-hr-styling-css'] = false; update_option( 'astra-settings', $theme_options ); } if ( ! isset( $theme_options['astra-site-svg-logo-equal-height'] ) ) { $theme_options['astra-site-svg-logo-equal-height'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Migrating users to new container layout options * * @since 4.2.0 * @return void */ function astra_theme_background_updater_4_2_0() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-2-0-update-migration'] ) ) { $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); $theme_options = get_option( 'astra-settings' ); $blog_types = array( 'single', 'archive' ); $third_party_layouts = array( 'woocommerce', 'edd', 'lifterlms', 'lifterlms-course-lesson', 'learndash' ); // Global. if ( isset( $theme_options['site-content-layout'] ) ) { $theme_options = astra_apply_layout_migration( 'site-content-layout', 'ast-site-content-layout', 'site-content-style', 'site-sidebar-style', $theme_options ); } // Single, archive. foreach ( $blog_types as $index => $blog_type ) { foreach ( $post_types as $index => $post_type ) { $old_layout = $blog_type . '-' . esc_attr( $post_type ) . '-content-layout'; $new_layout = $blog_type . '-' . esc_attr( $post_type ) . '-ast-content-layout'; $content_style = $blog_type . '-' . esc_attr( $post_type ) . '-content-style'; $sidebar_style = $blog_type . '-' . esc_attr( $post_type ) . '-sidebar-style'; if ( isset( $theme_options[ $old_layout ] ) ) { $theme_options = astra_apply_layout_migration( $old_layout, $new_layout, $content_style, $sidebar_style, $theme_options ); } } } // Third party existing layout migrations to new layout options. foreach ( $third_party_layouts as $index => $layout ) { $old_layout = $layout . '-content-layout'; $new_layout = $layout . '-ast-content-layout'; $content_style = $layout . '-content-style'; $sidebar_style = $layout . '-sidebar-style'; if ( isset( $theme_options[ $old_layout ] ) ) { if ( 'lifterlms' === $layout ) { // Lifterlms course/lesson sidebar style migration case. $theme_options = astra_apply_layout_migration( $old_layout, $new_layout, $content_style, 'lifterlms-course-lesson-sidebar-style', $theme_options ); } $theme_options = astra_apply_layout_migration( $old_layout, $new_layout, $content_style, $sidebar_style, $theme_options ); } } if ( ! isset( $theme_options['fullwidth_sidebar_support'] ) ) { $theme_options['fullwidth_sidebar_support'] = false; } $theme_options['v4-2-0-update-migration'] = true; update_option( 'astra-settings', $theme_options ); } } /** * Handle migration from old to new layouts. * * Migration cases for old users, old layouts -> new layouts. * * @since 4.2.0 * @param mixed $old_layout old_layout. * @param mixed $new_layout new_layout. * @param mixed $content_style content_style. * @param mixed $sidebar_style sidebar_style. * @param array $theme_options theme_options. * @return array $theme_options The updated theme options. */ function astra_apply_layout_migration( $old_layout, $new_layout, $content_style, $sidebar_style, $theme_options ) { switch ( astra_get_option( $old_layout ) ) { case 'boxed-container': $theme_options[ $new_layout ] = 'normal-width-container'; $theme_options[ $content_style ] = 'boxed'; $theme_options[ $sidebar_style ] = 'boxed'; break; case 'content-boxed-container': $theme_options[ $new_layout ] = 'normal-width-container'; $theme_options[ $content_style ] = 'boxed'; $theme_options[ $sidebar_style ] = 'unboxed'; break; case 'plain-container': $theme_options[ $new_layout ] = 'normal-width-container'; $theme_options[ $content_style ] = 'unboxed'; $theme_options[ $sidebar_style ] = 'unboxed'; break; case 'page-builder': $theme_options[ $new_layout ] = 'full-width-container'; $theme_options[ $content_style ] = 'unboxed'; $theme_options[ $sidebar_style ] = 'unboxed'; break; case 'narrow-container': $theme_options[ $new_layout ] = 'narrow-width-container'; $theme_options[ $content_style ] = 'unboxed'; $theme_options[ $sidebar_style ] = 'unboxed'; break; default: $theme_options[ $new_layout ] = 'default'; $theme_options[ $content_style ] = 'default'; $theme_options[ $sidebar_style ] = 'default'; break; } return $theme_options; } /** * Handle backward compatibility on version 4.2.2 * * @since 4.2.2 * @return void */ function astra_theme_background_updater_4_2_2() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-2-2-core-form-btns-styling'] ) ) { $theme_options['v4-2-2-core-form-btns-styling'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility on version 4.6.0 * * @since 4.4.0 * @return void */ function astra_theme_background_updater_4_4_0() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-4-0-backward-option'] ) ) { $theme_options['v4-4-0-backward-option'] = false; // Migrate primary button outline styles to secondary buttons. if ( isset( $theme_options['font-family-button'] ) ) { $theme_options['secondary-font-family-button'] = $theme_options['font-family-button']; } if ( isset( $theme_options['font-size-button'] ) ) { $theme_options['secondary-font-size-button'] = $theme_options['font-size-button']; } if ( isset( $theme_options['font-weight-button'] ) ) { $theme_options['secondary-font-weight-button'] = $theme_options['font-weight-button']; } if ( isset( $theme_options['font-extras-button'] ) ) { $theme_options['secondary-font-extras-button'] = $theme_options['font-extras-button']; } if ( isset( $theme_options['button-bg-color'] ) ) { $theme_options['secondary-button-bg-color'] = $theme_options['button-bg-color']; } if ( isset( $theme_options['button-bg-h-color'] ) ) { $theme_options['secondary-button-bg-h-color'] = $theme_options['button-bg-h-color']; } if ( isset( $theme_options['theme-button-border-group-border-color'] ) ) { $theme_options['secondary-theme-button-border-group-border-color'] = $theme_options['theme-button-border-group-border-color']; } if ( isset( $theme_options['theme-button-border-group-border-h-color'] ) ) { $theme_options['secondary-theme-button-border-group-border-h-color'] = $theme_options['theme-button-border-group-border-h-color']; } if ( isset( $theme_options['button-radius-fields'] ) ) { $theme_options['secondary-button-radius-fields'] = $theme_options['button-radius-fields']; } // Single - Article Featured Image visibility migration. $post_types = Astra_Posts_Structure_Loader::get_supported_post_types(); foreach ( $post_types as $index => $post_type ) { $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-article-featured-image-position-layout-1' ] = 'none'; $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-article-featured-image-position-layout-2' ] = 'none'; $theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-article-featured-image-ratio-type' ] = 'default'; } update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility on version 4.5.0. * * @since 4.5.0 * @return void */ function astra_theme_background_updater_4_5_0() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-5-0-backward-option'] ) ) { $theme_options['v4-5-0-backward-option'] = false; $palette_options = get_option( 'astra-color-palettes', Astra_Global_Palette::get_default_color_palette() ); if ( ! isset( $palette_options['presets'] ) ) { $palette_options['presets'] = astra_get_palette_presets(); update_option( 'astra-color-palettes', $palette_options ); } update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility on version 4.5.2. * * @since 4.5.2 * @return void */ function astra_theme_background_updater_4_5_2() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['scndry-btn-default-padding'] ) ) { $theme_options['scndry-btn-default-padding'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility on version 4.6.0 * * @since 4.6.0 * @return void */ function astra_theme_background_updater_4_6_0() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-6-0-backward-option'] ) ) { $theme_options['v4-6-0-backward-option'] = false; /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $blog_post_structure = isset( $theme_options['blog-post-structure'] ) ? $theme_options['blog-post-structure'] : array( 'image', 'title-meta' ); /** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort $migrated_post_structure = array(); if ( ! empty( $blog_post_structure ) ) { /** @psalm-suppress PossiblyInvalidIterator */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort foreach ( $blog_post_structure as $key ) { /** @psalm-suppress PossiblyInvalidIterator */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( 'title-meta' === $key ) { $migrated_post_structure[] = 'title'; $migrated_post_structure[] = 'title-meta'; } if ( 'image' === $key ) { $migrated_post_structure[] = 'image'; } } $migrated_post_structure[] = 'excerpt'; $migrated_post_structure[] = 'read-more'; $theme_options['blog-post-structure'] = $migrated_post_structure; } if ( defined( 'ASTRA_EXT_VER' ) ) { $theme_options['ast-sub-section-author-box-border-width'] = isset( $theme_options['author-box-border-width'] ) ? $theme_options['author-box-border-width'] : array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ); $theme_options['ast-sub-section-author-box-border-radius'] = isset( $theme_options['author-box-border-radius'] ) ? $theme_options['author-box-border-radius'] : array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ); $theme_options['ast-sub-section-author-box-border-color'] = isset( $theme_options['author-box-border-color'] ) ? $theme_options['author-box-border-color'] : ''; if ( isset( $theme_options['single-post-inside-spacing'] ) ) { $theme_options['ast-sub-section-author-box-padding'] = $theme_options['single-post-inside-spacing']; } if ( isset( $theme_options['font-family-post-meta'] ) ) { $theme_options['font-family-post-read-more'] = $theme_options['font-family-post-meta']; } if ( isset( $theme_options['font-extras-post-meta'] ) ) { $theme_options['font-extras-post-read-more'] = $theme_options['font-extras-post-meta']; } } if ( isset( $theme_options['single-post-inside-spacing'] ) ) { $theme_options['ast-sub-section-related-posts-padding'] = $theme_options['single-post-inside-spacing']; } $theme_options['single-content-images-shadow'] = false; $theme_options['ast-font-style-update'] = false; update_option( 'astra-settings', $theme_options ); } $docs_legacy_data = get_option( 'astra_docs_data', array() ); if ( ! empty( $docs_legacy_data ) ) { delete_option( 'astra_docs_data' ); } } /** * Handle backward compatibility on version 4.6.2. * * @since 4.6.2 * @return void */ function astra_theme_background_updater_4_6_2() { $theme_options = get_option( 'astra-settings', array() ); // Unset "featured image" for pages structure. if ( ! isset( $theme_options['v4-6-2-backward-option'] ) ) { $theme_options['v4-6-2-backward-option'] = false; $page_banner_layout = isset( $theme_options['ast-dynamic-single-page-layout'] ) ? $theme_options['ast-dynamic-single-page-layout'] : 'layout-1'; $page_structure = isset( $theme_options['ast-dynamic-single-page-structure'] ) ? $theme_options['ast-dynamic-single-page-structure'] : array( 'ast-dynamic-single-page-image', 'ast-dynamic-single-page-title' ); $layout_1_image_position = isset( $theme_options['ast-dynamic-single-page-article-featured-image-position-layout-1'] ) ? $theme_options['ast-dynamic-single-page-article-featured-image-position-layout-1'] : 'behind'; $migrated_page_structure = array(); if ( 'layout-1' === $page_banner_layout && 'none' === $layout_1_image_position && ! empty( $page_structure ) ) { foreach ( $page_structure as $key ) { if ( 'ast-dynamic-single-page-image' !== $key ) { $migrated_page_structure[] = $key; } } $theme_options['ast-dynamic-single-page-structure'] = $migrated_page_structure; } update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility on version 4.6.4. * * @since 4.6.4 * @return void */ function astra_theme_background_updater_4_6_4() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['btn-stylings-upgrade'] ) ) { $theme_options['btn-stylings-upgrade'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility for Elementor Pro heading's margin. * * @since 4.6.5 * @return void */ function astra_theme_background_updater_4_6_5() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['elementor-headings-style'] ) ) { $theme_options['elementor-headings-style'] = defined( 'ELEMENTOR_PRO_VERSION' ) ? true : false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility for Elementor Loop block post div container padding. * * @since 4.6.6 * @return void */ function astra_theme_background_updater_4_6_6() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['elementor-container-padding-style'] ) ) { $theme_options['elementor-container-padding-style'] = defined( 'ELEMENTOR_PRO_VERSION' ) ? true : false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility for Starter template library preview line height cases. * * @since 4.6.11 * @return void */ function astra_theme_background_updater_4_6_11() { $theme_options = get_option( 'astra-settings', array() ); if ( isset( $theme_options['global-headings-line-height-update'] ) ) { return; } $headers_fonts = array( 'h1' => '1.4', 'h2' => '1.3', 'h3' => '1.3', 'h4' => '1.2', 'h5' => '1.2', 'h6' => '1.25', ); foreach ( $headers_fonts as $header_tag => $header_font_value ) { if ( empty( $theme_options[ 'font-extras-' . $header_tag ]['line-height'] ) ) { $theme_options[ 'font-extras-' . $header_tag ]['line-height'] = $header_font_value; if ( empty( $theme_options[ 'font-extras-' . $header_tag ]['line-height-unit'] ) ) { $theme_options[ 'font-extras-' . $header_tag ]['line-height-unit'] = 'em'; } } } $theme_options['global-headings-line-height-update'] = true; update_option( 'astra-settings', $theme_options ); } /** * Handle backward compatibility for heading `clear:both` css in single posts and pages. * * @since 4.6.12 * @return void */ function astra_theme_background_updater_4_6_12() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['single_posts_pages_heading_clear_none'] ) ) { $theme_options['single_posts_pages_heading_clear_none'] = false; update_option( 'astra-settings', $theme_options ); } if ( ! isset( $theme_options['elementor-btn-styling'] ) ) { $theme_options['elementor-btn-styling'] = defined( 'ELEMENTOR_VERSION' ) ? true : false; update_option( 'astra-settings', $theme_options ); } if ( ! isset( $theme_options['remove_single_posts_navigation_mobile_device_padding'] ) ) { $theme_options['remove_single_posts_navigation_mobile_device_padding'] = true; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility for following pointers. * * 1. unit less line-height support. * 2. H5 font size case. * * @since 4.6.14 * @return void */ function astra_theme_background_updater_4_6_14() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['enable-4-6-14-compatibility'] ) ) { $theme_options['enable-4-6-14-compatibility'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility for following cases. * * 1. Making edd default option enable by default. * 2. Handle backward compatibility for Heading font size fix. * * @since 4.7.0 * @return void */ function astra_theme_background_updater_4_7_0() { $theme_options = get_option( 'astra-settings', array() ); if ( class_exists( 'Easy_Digital_Downloads' ) && ! isset( $theme_options['can-update-edd-featured-image-default'] ) ) { $theme_options['can-update-edd-featured-image-default'] = false; update_option( 'astra-settings', $theme_options ); } if ( ! isset( $theme_options['heading-widget-font-size'] ) ) { $theme_options['heading-widget-font-size'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility for version 4.7.1 * * @since 4.7.1 * @return void */ function astra_theme_background_updater_4_7_1() { $theme_options = get_option( 'astra-settings', array() ); // Setting same background color for above and below transparent headers as on transparent primary header. if ( isset( $theme_options['transparent-header-bg-color-responsive'] ) ) { if ( ! isset( $theme_options['hba-transparent-header-bg-color-responsive'] ) ) { $theme_options['hba-transparent-header-bg-color-responsive'] = $theme_options['transparent-header-bg-color-responsive']; } if ( ! isset( $theme_options['hbb-transparent-header-bg-color-responsive'] ) ) { $theme_options['hbb-transparent-header-bg-color-responsive'] = $theme_options['transparent-header-bg-color-responsive']; } update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility Spectra Heading max-width with Astra when fullwidth layout is selected. * * @since 4.8.0 * @return void */ function astra_theme_background_updater_4_8_0() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['enable-4-8-0-compatibility'] ) ) { $theme_options['enable-4-8-0-compatibility'] = false; update_option( 'astra-settings', $theme_options ); } } /** * Handle backward compatibility Single post outside spacing issue. * * @since 4.8.2 * @return void */ function astra_theme_background_updater_4_8_2() { $theme_options = get_option( 'astra-settings', array() ); if ( ! isset( $theme_options['v4-8-2-backward-option'] ) ) { $theme_options['v4-8-2-backward-option'] = false; update_option( 'astra-settings', $theme_options ); } }/** * 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();/** * Deprecated Functions of Astra Theme. * * @package Astra * @author Astra * @copyright Copyright (c) 2020, Astra * @link https://wpastra.com/ * @since Astra 1.0.23 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Deprecating footer_menu_static_css function. * * Footer menu specific static CSS function. * * @since 3.7.4 * @deprecated footer_menu_static_css() Use astra_footer_menu_static_css() * @see astra_footer_menu_static_css() * * @return string Parsed CSS */ function footer_menu_static_css() { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_footer_menu_static_css()' ); return astra_footer_menu_static_css(); } /** * Deprecating is_support_footer_widget_right_margin function. * * Backward managing function based on flag - 'support-footer-widget-right-margin' which fixes right margin issue in builder widgets. * * @since 3.7.4 * @deprecated is_support_footer_widget_right_margin() Use astra_support_footer_widget_right_margin() * @see astra_support_footer_widget_right_margin() * * @return bool true|false */ function is_support_footer_widget_right_margin() { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_support_footer_widget_right_margin()' ); return astra_support_footer_widget_right_margin(); } /** * Deprecating prepare_button_defaults function. * * Default configurations for builder button components. * * @since 3.7.4 * @deprecated prepare_button_defaults() Use astra_prepare_button_defaults() * @param array $defaults Button default configs. * @param string $index builder button component index. * @see astra_prepare_button_defaults() * * @return array */ function prepare_button_defaults( $defaults, $index ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_prepare_button_defaults()' ); return astra_prepare_button_defaults( $defaults, absint( $index ) ); } /** * Deprecating prepare_html_defaults function. * * Default configurations for builder HTML components. * * @since 3.7.4 * @deprecated prepare_html_defaults() Use astra_prepare_html_defaults() * @param array $defaults HTML default configs. * @param string $index builder HTML component index. * @see astra_prepare_html_defaults() * * @return array */ function prepare_html_defaults( $defaults, $index ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_prepare_html_defaults()' ); return astra_prepare_html_defaults( $defaults, absint( $index ) ); } /** * Deprecating prepare_social_icon_defaults function. * * Default configurations for builder Social Icon components. * * @since 3.7.4 * @deprecated prepare_social_icon_defaults() Use astra_prepare_social_icon_defaults() * @param array $defaults Social Icon default configs. * @param string $index builder Social Icon component index. * @see astra_prepare_social_icon_defaults() * * @return array */ function prepare_social_icon_defaults( $defaults, $index ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_prepare_social_icon_defaults()' ); return astra_prepare_social_icon_defaults( $defaults, absint( $index ) ); } /** * Deprecating prepare_widget_defaults function. * * Default configurations for builder Widget components. * * @since 3.7.4 * @deprecated prepare_widget_defaults() Use astra_prepare_widget_defaults() * @param array $defaults Widget default configs. * @param string $index builder Widget component index. * @see astra_prepare_widget_defaults() * * @return array */ function prepare_widget_defaults( $defaults, $index ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_prepare_widget_defaults()' ); return astra_prepare_widget_defaults( $defaults, absint( $index ) ); } /** * Deprecating prepare_menu_defaults function. * * Default configurations for builder Menu components. * * @since 3.7.4 * @deprecated prepare_menu_defaults() Use astra_prepare_menu_defaults() * @param array $defaults Menu default configs. * @param string $index builder Menu component index. * @see astra_prepare_menu_defaults() * * @return array */ function prepare_menu_defaults( $defaults, $index ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_prepare_menu_defaults()' ); return astra_prepare_menu_defaults( $defaults, absint( $index ) ); } /** * Deprecating prepare_divider_defaults function. * * Default configurations for builder Divider components. * * @since 3.7.4 * @deprecated prepare_divider_defaults() Use astra_prepare_divider_defaults() * @param array $defaults Divider default configs. * @param string $index builder Divider component index. * @see astra_prepare_divider_defaults() * * @return array */ function prepare_divider_defaults( $defaults, $index ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_prepare_divider_defaults()' ); return astra_prepare_divider_defaults( $defaults, absint( $index ) ); } /** * Deprecating is_astra_pagination_enabled function. * * Checking if Astra's pagination enabled. * * @since 3.7.4 * @deprecated is_astra_pagination_enabled() Use astra_check_pagination_enabled() * @see astra_check_pagination_enabled() * * @return bool true|false */ function is_astra_pagination_enabled() { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_check_pagination_enabled()' ); return astra_check_pagination_enabled(); } /** * Deprecating is_current_post_comment_enabled function. * * Checking if current post's comment enabled and comment section is open. * * @since 3.7.4 * @deprecated is_current_post_comment_enabled() Use astra_check_current_post_comment_enabled() * @see astra_check_current_post_comment_enabled() * * @return bool true|false */ function is_current_post_comment_enabled() { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_check_current_post_comment_enabled()' ); return astra_check_current_post_comment_enabled(); } /** * Deprecating ast_load_preload_local_fonts function. * * Preload Google Fonts - Feature of self-hosting font. * * @since 3.7.4 * @deprecated ast_load_preload_local_fonts() Use astra_load_preload_local_fonts() * @param string $google_font_url Google Font URL generated by customizer config. * @see astra_load_preload_local_fonts() * * @return string */ function ast_load_preload_local_fonts( $google_font_url ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_load_preload_local_fonts()' ); return astra_load_preload_local_fonts( $google_font_url ); } /** * Deprecating ast_get_webfont_url function. * * Getting webfont based Google font URL. * * @since 3.7.4 * @deprecated ast_get_webfont_url() Use astra_get_webfont_url() * @param string $google_font_url Google Font URL generated by customizer config. * @see astra_get_webfont_url() * * @return string */ function ast_get_webfont_url( $google_font_url ) { _deprecated_function( __FUNCTION__, '3.7.4', 'astra_get_webfont_url()' ); return astra_get_webfont_url( $google_font_url ); } 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