b0y-101 Mini Shell


Current Path : E:/wordpress/wp-content/plugins/wpml-to-polylang/src/
File Upload :
Current File : E:/wordpress/wp-content/plugins/wpml-to-polylang/src/Plugin.php

<?php
/**
 * PHP version 5.6
 *
 * @package wpml-to-polylang
 */

namespace WP_Syntex\WPML_To_Polylang;

defined( 'ABSPATH' ) || exit;

/**
 * Main plugin class.
 *
 * @since 0.5
 */
class Plugin {
	/**
	 * Uses PLL_Admin_Model to be able to create languages.
	 *
	 * @since 0.5
	 *
	 * @return string
	 */
	public function filterModel() {
		return 'PLL_Admin_Model';
	}

	/**
	 * Initializes the plugin.
	 *
	 * @since 0.5
	 *
	 * @return void
	 */
	public function init() {
		add_filter( 'pll_model', [ $this, 'filterModel' ] );

		$actions = [
			new Languages(),
			new Posts(),
			new Terms(),
			new Menus(),
			new NoLangObjects(),
			new Strings(),
			new Options(),
		];

		$nextAction = '';

		foreach ( array_reverse( $actions ) as $action ) {
			if ( ! empty( $nextAction ) ) {
				$action->setNext( $nextAction );
			}

			$action->addHooks();
			$nextAction = $action->getName();
		}

		$page = new Page( reset( $actions )->getName() );
		$page->addHooks();
	}
}

Copyright © 2019 by b0y-101