admin_url( 'admin-ajax.php' ), 'currentLanguage' => wplng_get_language_current_id(), 'message' => array( 'exitPage' => esc_html__( 'You are about to leave the page without saving your changes. They will be lost if you continue. Would you like to leave the page anyway?', 'wplingua' ), 'exitEditorModal' => esc_html__( 'You are about to exit without saving your changes. They will be lost if you continue. Would you like to leave anyway?', 'wplingua' ), 'buttonSave' => esc_html__( 'Save', 'wplingua' ), 'buttonSaveInProgress' => esc_html__( 'Save in progress...', 'wplingua' ), ), ) ); } } /** * Add custom inline styles for wpLingua. * * This function retrieves custom CSS from the database (stored in the 'wplng_custom_css' option), * sanitizes it, and outputs it directly into the section of the page. * * @return void */ function wplng_add_custom_inline_styles() { if ( ! empty( $_GET['wplng-mode'] ) && 'list' === $_GET['wplng-mode'] ) { return; } $custom_css = get_option( 'wplng_custom_css' ); if ( ! empty( $custom_css ) && is_string( $custom_css ) ) { $custom_css = wp_strip_all_tags( $custom_css ); echo ''; } } /** * Print the on page scrip * * @return void */ function wplng_on_page_script() { if ( ! empty( $_GET['wplng-load'] ) ) { return; } $script = file_get_contents( WPLNG_PLUGIN_DIR . '/assets/js/on-page.js' ); if ( empty( $script ) ) { return; } $script = str_replace( array( '[admin-ajax-php]', '[wplng-cookie-path]', '//# sourceMappingURL=on-page.js.map' ), array( admin_url( 'admin-ajax.php' ), COOKIEPATH, '' ), $script ); echo ''; }