I want to return the date and title together with WordPress mwwform plug-in.

Asked 1 years ago, Updated 1 years ago, 81 views

Edit function.php for WordPoress plug-in MWWPFORM.

Now I can return the title and date individually to the form, but I would like to return them all together.

I'm sorry that I can't explain it well, but the following code only returns the date.Then, if you change the date and title from return 〇 から を, only the title will be returned.

Can I return the date and title together?

 function my_mwform_value($value,$name){
    if($name==='kijidate'&&!empty($_GET['post_id'])&!is_array($_GET['post_id']){
        return get_the_date('m-d-day-Y', $_GET['post_id']);
        return get_the_title($_GET['post_id']);
    }
    return$value;   
}
add_filter('mwform_value_mw-wp-form-14378', 'my_mwform_value', 10, 2);

php wordpress

2022-09-30 21:45

1 Answers

Continuous returns are not possible.

return get_the_date('m-d-day-Y', $_GET['post_id']).get_the_title($_GET['post_id']);


2022-09-30 21:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.