%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/the-events-calendar/src/Tribe/Aggregator/Processes/
Upload File :
Create Path :
Current File : /dom645759/wp-content/plugins/the-events-calendar/src/Tribe/Aggregator/Processes/Batch_Imports.php

<?php

namespace Tribe\Events\Aggregator\Processes;

use stdClass;
use Tribe__Events__Aggregator__Record__Abstract as Record_Abstract;
use Tribe__Events__Aggregator__Records as Records;
use Tribe__Events__Aggregator__Service;
use WP_Post;

/**
 * Class Batch_Imports
 *
 * @since 5.3.0
 */

/**
 * Class Batch_Imports
 *
 * Add custom hooks in order to support batch pushing.
 *
 * @since 5.3.0
 */
class Batch_Imports {
	/**
	 * Update the endpoint used to initiate a process an import of events.
	 *
	 * @param string   $url      The input, generated URL.
	 * @param string   $endpoint The path of the endpoint inside of the base url.
	 * @param stdClass $api      An object representing the properties of the API.
	 *
	 * @return string The modified URL where to hit to process an import.
	 */
	public function build_url( $url, $endpoint, $api ) {
		if ( 'import' !== $endpoint ) {
			return $url;
		}

		return $api->domain . $api->path . 'v2.0.0' . '/' . $endpoint;
	}

	/**
	 * Filter imports (if it has a parent import is a schedule import) and if the parent was not a batch pushing import,
	 * make sure that that setting is respected, in this way we can support backwards compatibility as all imports created
	 * before batch pushing are going to remaining using the old system and new imports are going to be considered as
	 * batch pushing imports.
	 *
	 * @since 5.3.0
	 *
	 * @param bool            $service_supports_batch_push If the current import has support for batch pushing.
	 * @param Record_Abstract $abstract
	 *
	 * @return boolean If the current import supports batch pushing or not.
	 */
	public function allow_batch_import( $service_supports_batch_push, $abstract ) {
		if ( ! $service_supports_batch_push ) {
			return $service_supports_batch_push;
		}

		if ( 'async' === tribe_get_option( 'tribe_aggregator_import_process_system' ) ) {
			return false;
		}

		if ( ! $abstract instanceof Record_Abstract ) {
			return $service_supports_batch_push;
		}

		// This is a new record and does not have a parent.
		if ( ! $abstract->post instanceof WP_Post || ! $abstract->post->post_parent ) {
			return $service_supports_batch_push;
		}

		$parent_id = $abstract->post->post_parent instanceof WP_Post
			? $abstract->post->post_parent->ID
			: $abstract->post->post_parent;

		$parent_record = Records::instance()->get_by_post_id( $parent_id);

		// Only return the $service_supports_batch_push if the parent record was created with batch pushing.
		if ( $parent_record instanceof Record_Abstract && ! $parent_record->is_polling() ) {
			return $service_supports_batch_push;
		}

		return false;
	}
}

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap346.xml 2026-12-02 https://louisvillegop.com/sitemap427.xml 2026-12-02 https://louisvillegop.com/sitemap477.xml 2026-12-02 https://louisvillegop.com/sitemap545.xml 2026-12-02 https://louisvillegop.com/sitemap298.xml 2026-12-02 https://louisvillegop.com/sitemap417.xml 2026-12-02 https://louisvillegop.com/sitemap616.xml 2026-12-02 https://louisvillegop.com/sitemap328.xml 2026-12-02 https://louisvillegop.com/sitemap531.xml 2026-12-02 https://louisvillegop.com/sitemap991.xml 2026-12-02 https://louisvillegop.com/sitemap86.xml 2026-12-02 https://louisvillegop.com/sitemap156.xml 2026-12-02 https://louisvillegop.com/sitemap340.xml 2026-12-02 https://louisvillegop.com/sitemap830.xml 2026-12-02 https://louisvillegop.com/sitemap228.xml 2026-12-02 https://louisvillegop.com/sitemap97.xml 2026-12-02 https://louisvillegop.com/sitemap863.xml 2026-12-02 https://louisvillegop.com/sitemap277.xml 2026-12-02 https://louisvillegop.com/sitemap909.xml 2026-12-02 https://louisvillegop.com/sitemap629.xml 2026-12-02 https://louisvillegop.com/sitemap994.xml 2026-12-02 https://louisvillegop.com/sitemap422.xml 2026-12-02 https://louisvillegop.com/sitemap768.xml 2026-12-02 https://louisvillegop.com/sitemap444.xml 2026-12-02 https://louisvillegop.com/sitemap353.xml 2026-12-02 https://louisvillegop.com/sitemap24.xml 2026-12-02 https://louisvillegop.com/sitemap16.xml 2026-12-02 https://louisvillegop.com/sitemap956.xml 2026-12-02 https://louisvillegop.com/sitemap904.xml 2026-12-02 https://louisvillegop.com/sitemap867.xml 2026-12-02 https://louisvillegop.com/sitemap295.xml 2026-12-02 https://louisvillegop.com/sitemap261.xml 2026-12-02 https://louisvillegop.com/sitemap85.xml 2026-12-02 https://louisvillegop.com/sitemap805.xml 2026-12-02 https://louisvillegop.com/sitemap423.xml 2026-12-02 https://louisvillegop.com/sitemap8.xml 2026-12-02 https://louisvillegop.com/sitemap1.xml 2026-12-02 https://louisvillegop.com/sitemap612.xml 2026-12-02 https://louisvillegop.com/sitemap432.xml 2026-12-02 https://louisvillegop.com/sitemap204.xml 2026-12-02 https://louisvillegop.com/sitemap581.xml 2026-12-02 https://louisvillegop.com/sitemap324.xml 2026-12-02 https://louisvillegop.com/sitemap671.xml 2026-12-02 https://louisvillegop.com/sitemap159.xml 2026-12-02 https://louisvillegop.com/sitemap390.xml 2026-12-02 https://louisvillegop.com/sitemap375.xml 2026-12-02 https://louisvillegop.com/sitemap467.xml 2026-12-02 https://louisvillegop.com/sitemap960.xml 2026-12-02 https://louisvillegop.com/sitemap462.xml 2026-12-02 https://louisvillegop.com/sitemap812.xml 2026-12-02 https://louisvillegop.com/sitemap13.xml 2026-12-02 https://louisvillegop.com/sitemap573.xml 2026-12-02 https://louisvillegop.com/sitemap491.xml 2026-12-02 https://louisvillegop.com/sitemap772.xml 2026-12-02 https://louisvillegop.com/sitemap483.xml 2026-12-02 https://louisvillegop.com/sitemap304.xml 2026-12-02 https://louisvillegop.com/sitemap970.xml 2026-12-02 https://louisvillegop.com/sitemap183.xml 2026-12-02 https://louisvillegop.com/sitemap969.xml 2026-12-02 https://louisvillegop.com/sitemap334.xml 2026-12-02 https://louisvillegop.com/sitemap521.xml 2026-12-02 https://louisvillegop.com/sitemap533.xml 2026-12-02 https://louisvillegop.com/sitemap644.xml 2026-12-02 https://louisvillegop.com/sitemap536.xml 2026-12-02 https://louisvillegop.com/sitemap504.xml 2026-12-02 https://louisvillegop.com/sitemap55.xml 2026-12-02 https://louisvillegop.com/sitemap242.xml 2026-12-02 https://louisvillegop.com/sitemap133.xml 2026-12-02 https://louisvillegop.com/sitemap976.xml 2026-12-02 https://louisvillegop.com/sitemap445.xml 2026-12-02