Created
April 17, 2020 03:25
-
-
Save platoosom/742e7fff640b36a68a2ee6f9f7a01975 to your computer and use it in GitHub Desktop.
wordpress check plugin activated เช็กว่าปลักอินเป้าหมาย activated หรือไม่
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( is_plugin_active('sitepress-multilingual-cms/sitepress.php') ) { | |
include_once( WP_PLUGIN_DIR . '/sitepress-multilingual-cms/inc/wpml-api.php' ); | |
$_POST['icl_post_language'] = $language_code = 'en'; // change the language code | |
wpml_add_translatable_content( 'post_my_post_type', $ID, $language_code ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment