Inventory_Presser_Contact_Form_7::get_submission_vehicle_post_id( string $vehicle_field_value = '' )
Find the post ID of the vehicle that was submitted in the first [invp_vehicle] field on this form. Returns false if not found.
On This Page
Parameters Parameters
- $vehicle_field_value
-
(string) (Optional) The submitted value in the form’s [invp_vehicle] field.
Default value: ''
Return Return
(int|false)
Source Source
File: includes/integrations/class-contact-form-7.php
public function get_submission_vehicle_post_id( $vehicle_field_value = '' ) {
if ( '' === $vehicle_field_value ) {
$submission = WPCF7_Submission::get_instance();
// What name in posted_data is the vehicle field?
foreach ( $submission->get_contact_form()->scan_form_tags() as $form_tag ) {
if ( 'invp_vehicle' !== $form_tag->basetype ) {
continue;
}
$vehicle_field_value = $submission->get_posted_data()[ $form_tag->name ];
break;
}
}
return $this->extract_post_id_from_value( $vehicle_field_value );
}
Expand full source codeCollapse full source codeView on Github