Hey guys,
since a few hours I'm running in a problem and I hope you can help.
I'm trying to set the value for the shortcode post_id via functions.php. I'm not setting it via GET parameter in the url and not via attribute in the wysiwyg editor of the post where I have embedded the form.
So here is my code:
add_filter( 'rwmb_frontend_field_value_post_id', 'my_custom_population_function', 10, 2 );
function my_custom_population_function( $value, $args ) {
if ( $args['id'] === 'car_informations' ) {
$value = 123;
}
return $value;
}
$value = apply_filters( "rwmb_frontend_field_value_post_id", $value, $args );
Maybe an important information. By trying to debug the problem, I've tried to print_r the $args array before the if() and it's empty.
Do you have any ideas?
Would be really cool – thank you! 🙂
Christoph