如何在评论标题中插入wordpress发布值?

我正在尝试将wordpress发布值$ offer_title插入评论框标题。标题当前显示为“ Leave Your Review”,但我希望它在“ review”部分之前显示“ $ offer_title”值,例如“ Leave Your XYZ Review”。


这是注释部分的当前代码...


$custom_comment_field = '<textarea id="comment" name="comment" cols="30" rows="10" aria-required="true"></textarea>';

$commenter = wp_get_current_commenter();

            comment_form(array(

                'comment_field'         => $custom_comment_field,

                'comment_notes_after'   => '',

                'logged_in_as'          => '',

                'comment_notes_before'  => '',

                'title_reply'           => __('Leave a Review', 'rehub_framework'),

                'cancel_reply_link'     => __('Cancel reply', 'rehub_framework'),

                'label_submit'          => __('Submit', 'rehub_framework'),

                'fields' => apply_filters( 'comment_form_default_fields', array(


                    'author' =>

                        '<div class="usr_re"><input id="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .'" name="author" placeholder="'.__('Name', 'rehub_framework').'"></div>',


                    'email' =>

                        '<div class="email_re"><input id="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) .'" name="email" placeholder="'.__('E-mail', 'rehub_framework').'"></div>',


                    'url' =>

                        '<div class="site_re end"><input id="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .'" name="url" placeholder="'.__('Website', 'rehub_framework').'"></div><div class="clearfix"></div>',

                )

              ),

            ));

任何提示将不胜感激。谢谢 :-)


守着星空守着你
浏览 152回答 1
1回答

泛舟湖上清波郎朗

替换以下行:'title_reply'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;__('Leave&nbsp;a&nbsp;Review',&nbsp;'rehub_framework'),和'title_reply'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;'Leave&nbsp;your&nbsp;'.&nbsp;$offer_title&nbsp;.'&nbsp;Review',
打开App,查看更多内容
随时随地看视频慕课网APP