-
-
Save dexit/6d2a1bccc0f7e21614db1c3f21f6e710 to your computer and use it in GitHub Desktop.
capture $_POST on specific page w/ Elementor widget of matching ID
This file contains hidden or 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 ( ! function_exists('write_log')) { | |
| function write_log ( $log ) { | |
| if ( is_array( $log ) || is_object( $log ) ) { | |
| error_log( print_r( $log, true ) ); | |
| } else { | |
| error_log( $log ); | |
| } | |
| } | |
| } | |
| add_action( 'elementor/frontend/section/before_render', function ( \Elementor\Element_Base $element ) { | |
| if ( is_page('my-special-page') && $element->get_settings('_element_id') === 'unique-id' ) { | |
| write_log('start'); | |
| write_log($_POST['fields']['field_id']['value']); | |
| write_log('end'); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment