Created
March 16, 2017 12:32
-
-
Save nmedia82/c01f46210c4d43b0fd35aab7a1c327eb to your computer and use it in GitHub Desktop.
N-Media Helper Functions File
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
/** | |
* WPML | |
* registering and translating strings input by users | |
*/ | |
if( ! function_exists('nm_wpml_register') ) { | |
function nm_wpml_register($field_value, $domain) { | |
$field_name = $domain . ' - ' . sanitize_key($field_value); | |
//WMPL | |
/** | |
* register strings for translation | |
* source: https://wpml.org/wpml-hook/wpml_register_single_string/ | |
*/ | |
do_action( 'wpml_register_single_string', $domain, $field_name, $field_value ); | |
//WMPL | |
} | |
} | |
if( ! function_exists('nm_wpml_translate') ) { | |
function nm_wpml_translate($field_value, $domain) { | |
$field_name = $domain . ' - ' . sanitize_key($field_value); | |
//WMPL | |
/** | |
* register strings for translation | |
* source: https://wpml.org/wpml-hook/wpml_translate_single_string/ | |
*/ | |
return apply_filters('wpml_translate_single_string', $field_value, $domain, $field_name ); | |
//WMPL | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment