HEX
Server: Apache
System: Linux beta.alfanet.ee 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: busines1 (1252)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/wp-seo-multilingual/classes/SlugTranslation/Hooks.php
<?php

namespace WPML\WPSEO\SlugTranslation;

use WPML\FP\Obj;

class Hooks implements \IWPML_Backend_Action, \IWPML_DIC_Action {

	public function add_hooks() {
		add_action( 'update_option_wpseo_titles', [ $this, 'flushRulesOnBreadcrumbChange' ], 10, 2 );
	}

	/**
	 * @param array $oldValue
	 * @param array $newValue
	 */
	public function flushRulesOnBreadcrumbChange( $oldValue, $newValue ) {
		$getBreadcrumbsSetting = Obj::prop( 'breadcrumbs-enable' );

		if ( $getBreadcrumbsSetting( $oldValue ) !== $getBreadcrumbsSetting( $newValue ) ) {
			add_action( 'shutdown', 'flush_rewrite_rules' );
		}
	}
}