Skip to content

Instantly share code, notes, and snippets.

@New0
Created November 8, 2019 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save New0/e37c8c5f413c75eff51f70bab7be3cac to your computer and use it in GitHub Desktop.
Save New0/e37c8c5f413c75eff51f70bab7be3cac to your computer and use it in GitHub Desktop.
Replace text in CF Connected Forms buttons
<?php
/*
* Plugin Name: CF custom code
* Author: New0
* Description: Force connected Submit button text if translation didn't apply
*/
add_action('wp_footer', function() {
?>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", connectedFormsButtonText);
jQuery( document ).ajaxComplete( connectedFormsButtonText );
function connectedFormsButtonText() {
if(jQuery("#cffld_nextnav_1").attr('value') === "Submit"){
jQuery("#cffld_nextnav_1").attr('value', 'Pošalji');
}
}
</script>
<?php
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment