Josh

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Redirect to previous page after login? #452941

    Josh
    Expired Member
    Post count: 11

    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!

    in reply to: Redirect to previous page after login? #452940

    Josh
    Expired Member
    Post count: 11

    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!

    in reply to: Certain Zip codes searching in other countries #448696

    Josh
    Expired Member
    Post count: 11

    Thanks, Stiofan! It seems to be working perfectly. I appreciate it!

    in reply to: Certain Zip codes searching in other countries #448658

    Josh
    Expired Member
    Post count: 11
    This reply has been marked as private.
    in reply to: Certain Zip codes searching in other countries #448477

    Josh
    Expired Member
    Post count: 11
    This reply has been marked as private.
    in reply to: Customize Add-on in Child Theme #445804

    Josh
    Expired Member
    Post count: 11

    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!

    in reply to: Customize Add-on in Child Theme #445805

    Josh
    Expired Member
    Post count: 11

    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!

Viewing 7 posts - 1 through 7 (of 7 total)