Support » Plugin: Permalink Manager Lite » bbPress Topic Reply Edit Error

  • Resolved mirallesdesign

    (@mirallesdesign)


    Hi! I wrote you some time ago because I had a problem with the edit Link on bbPress Topics, because it didn’t work. Now it does, but the Replies Edit Link does not, please help. Thanks

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @mirallesdesign,

    Could you send me a full sample “reply edit” URL? Does the URL redirect somewhere else or return 404 error?

    Please also send me the debug data:
    https://thegtahouse.com/edit-reply-url?debug_url=1

    Best regards,
    Maciej

    Plugin Author Maciej Bis

    (@mbis)

    Hi again @mirallesdesign,

    I took a look at your website and it looks like ‘edit’ endpoint is no longer added.

    Could you check if the below code is still present in functions.php file in your child theme?

    function pm_bbpress_endpoints($endpoints) {
    	return "{$endpoints}|edit";
    }
    add_filter('permalink_manager_endpoints', 'pm_bbpress_endpoints');
    
    function pm_stop_bbpress_redirect() {
        global $wp_query;
    
        if(!empty($wp_query->query_vars['edit'])) {
            $wp_query->query_vars['do_not_redirect'] = 1;
        }
    }
    add_action('wp', 'pm_stop_bbpress_redirect');

    Best regards,
    Maciej

    Plugin Author Maciej Bis

    (@mbis)

    To whom it may concern:

    The /edit/ endpoint in 2.2.8.7 version of Permalink Manager will work only if it remains unchanged. To make them working you will need an additional snippet:

    function bbpress_detect_endpoints() {
        global $wp_query;
     
        if(!empty($wp_query->query)) {
            $edit_endpoint = bbp_get_edit_slug();
     
            if(isset($wp_query->query[$edit_endpoint])) {
                if(isset($wp_query->query['forum'])) {
                    $wp_query->bbp_is_forum_edit = true;
                } else if(isset($wp_query->query['topic'])) {
                    $wp_query->bbp_is_topic_edit = true;
                } else if(isset($wp_query->query['reply'])) {
                    $wp_query->bbp_is_reply_edit = true;
                }
            }
        }
    }
    add_action('wp', 'bbpress_detect_endpoints', 1);

    It will be included in Permalink Manager’s code from 2.2.8.8 version.

    Best regards,
    Maciej

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.