Inventory_Presser_Contact_Form_7::prepare_value( int $post_id = null )
prepare_value
Parameters Parameters
- $post_id
-
(int) (Optional)
Default value: null
Return Return
(string)
Source Source
File: includes/integrations/class-contact-form-7.php
protected function prepare_value( $post_id = null ) {
$post_id = $post_id ?? get_the_ID();
$value = trim(
sprintf(
'%s %s %s',
invp_get_the_year( $post_id ),
invp_get_the_make( $post_id ),
invp_get_the_model( $post_id )
)
);
$trim = invp_get_the_trim( $post_id );
if ( ! empty( $trim ) ) {
$value .= ' ' . $trim;
}
$stock_number = invp_get_the_stock_number( $post_id );
if ( ! empty( $stock_number ) ) {
$value .= ', ' . $stock_number;
}
return $value;
}
Expand full source codeCollapse full source codeView on Github