• Resolved sonisitez

    (@sonisitez)


    Hi, its possible to changes button “Save Changes To Database” in front end form without editing the WPDA_Simple_Form.php? Because after update my custom gone? Thank you

Viewing 1 replies (of 1 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Yes, you can! 😉 Please check out filter wpda_after_simple_form:
    https://wpdataaccess.com/2020/01/29/action-hook-wpda-after-simple-form-to-add-custom-elements-to-end-of-data-entry-forms/

    Of course I wanted to test this for myself as well! 🙂 Below is the code to change the label to SAVE. Please be aware that this only works if you are in the Data Explorer (?page=wpda). If you want to use it on other pages, just add your menu slug.

    <?php
    function change_button_label( $self ) {
    	if ( isset( $_REQUEST['page'] ) && 'wpda' === $_REQUEST['page'] ) {
    		?>
    		<script type="text/javascript">
    			jQuery(document).ready(function() {
    				jQuery('.button-primary').val('SAVE');
    			});
    		</script>
    		<?php
    	}
    }
    add_action( 'wpda_after_simple_form', 'change_button_label', 10, 1);
    ?>

    Best regards,
    Peter

Viewing 1 replies (of 1 total)

The topic ‘Button ‘Save Changes To Database’’ is closed to new replies.