Skip to content

Instantly share code, notes, and snippets.

@dexit
Forked from pingram3541/functions.php
Created July 25, 2025 10:36
Show Gist options
  • Save dexit/6d2a1bccc0f7e21614db1c3f21f6e710 to your computer and use it in GitHub Desktop.
Save dexit/6d2a1bccc0f7e21614db1c3f21f6e710 to your computer and use it in GitHub Desktop.
capture $_POST on specific page w/ Elementor widget of matching ID
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