first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?php
/**
* @author OnTheGo Systems
*/
class WPML_TM_Shortcodes_Catcher_Factory implements IWPML_Frontend_Action_Loader, IWPML_Backend_Action_Loader, IWPML_AJAX_Action_Loader {
/**
* @return IWPML_Action|IWPML_Action[]|null
*/
public function create() {
return new WPML_TM_Shortcodes_Catcher();
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* @author OnTheGo Systems
*/
class WPML_TM_Shortcodes_Catcher implements IWPML_Action {
public function add_hooks() {
add_filter( 'pre_do_shortcode_tag', array( $this, 'register_shortcode' ), 10, 2 );
}
public function register_shortcode( $return, $tag ) {
if ( $tag ) {
$registered_shortcodes = get_option( WPML_TM_XLIFF_Shortcodes::SHORTCODE_STORE_OPTION_KEY, array() );
if ( ! in_array( $tag, $registered_shortcodes, true ) ) {
$registered_shortcodes[] = $tag;
update_option( WPML_TM_XLIFF_Shortcodes::SHORTCODE_STORE_OPTION_KEY, $registered_shortcodes, false );
}
}
return $return;
}
}