Skip to:
Content
Pages
Categories
Search
Top
Bottom

Old post “edit” link makes too many redirects

  • @shablon

    Participant

    Since there is a time limit to editing post and no way to set it to unlimited (I wonder why, but that’s a question for another day), I’ve set the limit to maximum. There also was an issue, where original “edit” button wouldn’t show up. I did a little research, and turned out that most of the time, it was theme conflict. Changing theme was not an option. So, I’ve just added a custom “edit” link to template. It looks like this
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>conversations/reply/<?php bbp_reply_id(); ?>/edit/" class="editbtn"> Edit</a>

    It works fine with newer posts. But when I tried editing one of older posts, I got following error:
    The mydomain.com page isn’t working
    mydomain.com redirected you too many times.

Viewing 1 replies (of 1 total)
  • @robin-w

    Moderator

    not tested but this code should allow editing at all times. Add it to your functions file

    add filter ('bbp_past_edit_lock' , 'rew_allow_editing' )
    
    function rew_allow_editing () {
    	$retval = false ;
    	Return $retval ;
    }

    on other posts, I’d wonder if the bbp_reply_id(); might be returning a null or the wrong id.

    As a test the easiest way would be to replace your Edit </a> with

    <?php echo esc_url( home_url( '/' ) ).'conversations/reply/'.bbp_reply_id().'/edit/' ?></a>
    

    That way you’ll see where it is going to send you and can find out what the problem is

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar