HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/www/wp-content/plugins/acfml/classes/strategy/repeater-sync/HooksFactory.php
<?php

namespace ACFML\Repeater\Sync;

use ACFML\Repeater\Shuffle\OptionsPage;
use ACFML\Repeater\Shuffle\Post;
use ACFML\Repeater\Shuffle\Resolver;
use ACFML\Repeater\Shuffle\Term;

class HooksFactory implements \IWPML_Backend_Action_Loader, \IWPML_Deferred_Action_Loader {

	/**
	 * @return string
	 */
	public function get_load_action() {
		return 'wp_loaded';
	}

	/**
	 * @return \IWPML_Action[]
	 */
	public function create() {
		$shuffled = Resolver::getStrategy();
		if ( ! $shuffled ) {
			return [];
		}

		$fieldState       = new \ACFML\FieldState( $shuffled );
		$customFieldsSync = new \WPML_ACF_Custom_Fields_Sync( $fieldState );

		$hooks = [
			$fieldState,
			$customFieldsSync,
			new \WPML_ACF_Repeater_Shuffle( $shuffled, $fieldState ),
			new CheckboxHooks( $shuffled ),
		];

		$checkboxCondition = new CheckboxCondition( $shuffled );

		if ( $shuffled instanceof Post ) {
			$hooks[] = new PostHooks( $shuffled, $checkboxCondition );
		} elseif ( $shuffled instanceof Term ) {
			$hooks[] = new TermHooks( $shuffled );
		} elseif ( $shuffled instanceof OptionsPage ) {
			$hooks[] = new OptionPageHooks( $shuffled, $checkboxCondition );
		}

		return $hooks;
	}
}