Created
December 11, 2019 19:18
-
-
Save pingram3541/b7c2c3b90c8754dbc2f3fb7bedf9e4a4 to your computer and use it in GitHub Desktop.
capture $_POST on specific page w/ Elementor widget of matching ID
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
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