Josh
Forum Replies Created
-
AuthorPosts
-
Thanks for the help, Guust! What I am actually hoping to accomplish is a redirect back to the listing, rather than to a specific page. Here is some code I’m using for the blog post comments, which gives me the functionality I’m looking for:
add_filter( 'comment_form_defaults', function( $fields ) { $fields['must_log_in'] = sprintf( __( '<p class="must-log-in">You must <a href="%s">login</a> to post a comment.</p>' ), geodir_login_url(array('redirect_to' => urlencode_deep(get_permalink()))) ); return $fields; });
Would you know if there is a way to do this similarly with reviews? I found the below code in the reviews.php, which seems to drive a url redirect as well, but behaves a bit differently than the code above. Would you know if there is a specific filter/hook I can use to modify it?
$args = apply_filters('geodir_review_form_args', array( 'title_reply' => __('Leave a Review', 'geodirectory'), 'label_submit' => __('Post Review', 'geodirectory'), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __('Review text', 'geodirectory') . ' <span class="required">*</span></label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required></textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'geodirectory'), geodir_login_url()) . '</p>' )); comment_form($args);
Thanks again for the help!
Thanks for the reply, Guust! What I am looking for is actually a redirect back to the previous listing after logging in, instead of a specific page.
Here is some code I’m using for blog post comments, that is giving me the functionality I’m looking for.
add_filter( 'comment_form_defaults', function( $fields ) { $fields['must_log_in'] = sprintf( __( '<p class="must-log-in">You must <a href="%s">login</a> to post a comment.</p>' ), geodir_login_url(array('redirect_to' => urlencode_deep(get_permalink()))) ); return $fields; });
Is there a way to do this with reviews? I found this inside of reviews.php within the plugin files; can this be modified similarly?
$args = apply_filters('geodir_review_form_args', array( 'title_reply' => __('Leave a Review', 'geodirectory'), 'label_submit' => __('Post Review', 'geodirectory'), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __('Review text', 'geodirectory') . ' <span class="required">*</span></label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required></textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'geodirectory'), geodir_login_url()) . '</p>' )); comment_form($args);
Thanks again for the help!
Thanks, Stiofan! It seems to be working perfectly. I appreciate it!
This reply has been marked as private.This reply has been marked as private.Thanks, Alex & Paolo! The hook and filter solution worked well!
Quick follow up question: Will the new fields automatically populate in the User Information within the Listing Claims Tab, or will that require additional customization?
Thanks again!
Thanks, Alex & Paolo! The hook and filter solution worked well!
Quick follow up question: Will the new fields automatically populate in the User Information within the Listing Claims Tab, or will that require additional customization?
Thanks again!
-
AuthorPosts