????

Your IP : 3.133.128.39


Current Path : /home/ntwf1swzbm0x/public_html/wp-includes/
Upload File :
Current File : /home/ntwf1swzbm0x/public_html/wp-includes/class-wp-paused-extensions-storage.php

<?php
/**
 * Error Protection API: WP_Paused_Extensions_Storage class
 *
 * @package WordPress
 * @since 5.2.0
 */

/**
 * Core class used for storing paused extensions.
 *
 * @since 5.2.0
 */
class WP_Paused_Extensions_Storage {

	/**
	 * Type of extension. Used to key extension storage.
	 *
	 * @since 5.2.0
	 * @var string
	 */
	protected $type;

	/**
	 * Constructor.
	 *
	 * @since 5.2.0
	 *
	 * @param string $extension_type Extension type. Either 'plugin' or 'theme'.
	 */
	public function __construct( $extension_type ) {
		$this->type = $extension_type;
	}

	/**
	 * Records an extension error.
	 *
	 * Only one error is stored per extension, with subsequent errors for the same extension overriding the
	 * previously stored error.
	 *
	 * @since 5.2.0
	 *
	 * @param string $extension Plugin or theme directory name.
	 * @param array  $error     {
	 *     Error that was triggered.
	 *
	 *     @type string $type    The error type.
	 *     @type string $file    The name of the file in which the error occurred.
	 *     @type string $line    The line number in which the error occurred.
	 *     @type string $message The error message.
	 * }
	 * @return bool True on success, false on failure.
	 */
	public function set( $extension, $error ) {
		if ( ! $this->is_api_loaded() ) {
			return false;
		}

		$option_name = $this->get_option_name();

		if ( ! $option_name ) {
			return false;
		}

		$paused_extensions = (array) get_option( $option_name, array() );

		// Do not update if the error is already stored.
		if ( isset( $paused_extensions[ $this->type ][ $extension ] ) && $paused_extensions[ $this->type ][ $extension ] === $error ) {
			return true;
		}

		$paused_extensions[ $this->type ][ $extension ] = $error;

		return update_option( $option_name, $paused_extensions );
	}

	/**
	 * Forgets a previously recorded extension error.
	 *
	 * @since 5.2.0
	 *
	 * @param string $extension Plugin or theme directory name.
	 * @return bool True on success, false on failure.
	 */
	public function delete( $extension ) {
		if ( ! $this->is_api_loaded() ) {
			return false;
		}

		$option_name = $this->get_option_name();

		if ( ! $option_name ) {
			return false;
		}

		$paused_extensions = (array) get_option( $option_name, array() );

		// Do not delete if no error is stored.
		if ( ! isset( $paused_extensions[ $this->type ][ $extension ] ) ) {
			return true;
		}

		unset( $paused_extensions[ $this->type ][ $extension ] );

		if ( empty( $paused_extensions[ $this->type ] ) ) {
			unset( $paused_extensions[ $this->type ] );
		}

		// Clean up the entire option if we're removing the only error.
		if ( ! $paused_extensions ) {
			return delete_option( $option_name );
		}

		return update_option( $option_name, $paused_extensions );
	}

	/**
	 * Gets the error for an extension, if paused.
	 *
	 * @since 5.2.0
	 *
	 * @param string $extension Plugin or theme directory name.
	 * @return array|null Error that is stored, or null if the extension is not paused.
	 */
	public function get( $extension ) {
		if ( ! $this->is_api_loaded() ) {
			return null;
		}

		$paused_extensions = $this->get_all();

		if ( ! isset( $paused_extensions[ $extension ] ) ) {
			return null;
		}

		return $paused_extensions[ $extension ];
	}

	/**
	 * Gets the paused extensions with their errors.
	 *
	 * @since 5.2.0
	 *
	 * @return array Associative array of extension slugs to the error recorded.
	 */
	public function get_all() {
		if ( ! $this->is_api_loaded() ) {
			return array();
		}

		$option_name = $this->get_option_name();

		if ( ! $option_name ) {
			return array();
		}

		$paused_extensions = (array) get_option( $option_name, array() );

		return isset( $paused_extensions[ $this->type ] ) ? $paused_extensions[ $this->type ] : array();
	}

	/**
	 * Remove all paused extensions.
	 *
	 * @since 5.2.0
	 *
	 * @return bool
	 */
	public function delete_all() {
		if ( ! $this->is_api_loaded() ) {
			return false;
		}

		$option_name = $this->get_option_name();

		if ( ! $option_name ) {
			return false;
		}

		$paused_extensions = (array) get_option( $option_name, array() );

		unset( $paused_extensions[ $this->type ] );

		if ( ! $paused_extensions ) {
			return delete_option( $option_name );
		}

		return update_option( $option_name, $paused_extensions );
	}

	/**
	 * Checks whether the underlying API to store paused extensions is loaded.
	 *
	 * @since 5.2.0
	 *
	 * @return bool True if the API is loaded, false otherwise.
	 */
	protected function is_api_loaded() {
		return function_exists( 'get_option' );
	}

	/**
	 * Get the option name for storing paused extensions.
	 *
	 * @since 5.2.0
	 *
	 * @return string
	 */
	protected function get_option_name() {
		if ( ! wp_recovery_mode()->is_active() ) {
			return '';
		}

		$session_id = wp_recovery_mode()->get_session_id();
		if ( empty( $session_id ) ) {
			return '';
		}

		return "{$session_id}_paused_extensions";
	}
}

dynamic-content-widget-a6b2991-1 – The Foundry
Apply Now!

Booth Rental

From $ 99 / month
  • 05 x 10 - $99 Per Month
  • 09 x 10 - $149 Per Month
  • 10 X 10 - $159 Per Month
  • 10 X 11 - $169 Per Month
  • 10 X 15 - $224 Per Month
  • 10 X 20 - $270 Per Month
  • 10 X 25 - $325 Per Month

Cases also available

Visit us at The Foundry and speak with a member of our team to discuss the options available to you. If a space is available you can move in straight away! If there is not a space available right away, you can opt to be placed on our vendor waiting list or look at an alternative option such as one of our bespoke display cases. 

No problem! We encourage prospective vendors to move in and start selling as soon as possible. Pro rated booth rent for the remaining period until the first of the following month will be due at contract signing.

Yes. We have a standard form contract which outlines the terms of your rental agreement.

We charge a commission of 10% on all sales.

No! Here at The Foundry we believe that you should discover the best selling environment for you. We have a six month initial term. Following this, we require just a thirty day written notice if you wish to change or terminate your rental agreement. 

Rent is paid in advance starting on the first day of every month. For example: The rent due for August is due on August first.

For the convenience of all our vendors, we automatically process your rent payment from your previous month sales. If you do not have sufficient sales to cover the rent due we will notify you that payment is required. We recommend that all vendors take advantage of our vendor sales tracking system, QuailHQ for $5.00 per month.  

We work in partnership with QuailHQ to provide online access to sales data 24 hours a day, 7 days a week. QuailHQ is available online and as an app for ios and android.

We recommend that all vendors take advantage of our vendor sales tracking system, QuailHQ for $5.00 per month.  

Yes! We operate Social Media accounts on various platforms. In addition to our renowned service, we also regularly feature select merchandise to our social media platforms to increase awareness and bolster vendor sales. Make sure to include interesting an unique merchandise in your booth to be in with a chance to be featured on our social media!

We are open daily from 10:00 AM to 6:00 PM for you to move in and start selling! From all of us at The Foundry, we loom forward to working with you and can’t wait for you to get started!