Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problem with admin links in custom loop


  • Niels van Renselaar
    Participant

    @nielsvanrenselaar

    Hello,

    I run a custom loop for some replies at a specific part in my template. I would like anyone that has the rights to edit these replies. I use bbp_reply_admin_links for that, but this function gives me NULL. When digging futher in to the code I see that bbp_is_reply equals NULL in bbp_reply_admin_links. Probably because im not in a “official” bbpress loop. Anyone has a solution? Manually calling bbp_get_admin_links($post->ID) does not do the trick. bbp_is_reply still gives false on that, because bbp_get_admin_links does not give the ID trough to bbp_is_reply.

                                 "reply",
                                            "post_parent" => get_the_ID(),
                                            "order" => "ASC", // First comments first
                                            "paged" => get_query_var("paged")
                                        )
                                    );
    
                                    $i = 1;
    
                                    if($replies->have_posts()) :
                                        while($replies->have_posts()) :
    
                                            $replies->the_post();
                                            $class = ($i % 2) ? "" : "mark";
    
                                            ?>
                                            <!-- reply -->
                                            &lt;li class=&quot;"&gt;
    
    
                                                    <!-- author -->
    
    
                                                        &lt;a href=&#039;post_author ); ?&gt;'&gt;post_author); ?&gt;
                                                        Administrator
    
                                                        &lt;img class=&quot;image&quot; src=&quot;/images/ico-27.gif" width="49" height="49" alt="image description" /&gt;
    
    
                                                            Niels van Renselaar 
                                                            Media-Enzo  
    
                                                            Posts:
    
    
    
    
                                                    <!-- reply -->
    
Viewing 1 replies (of 1 total)

  • Niels van Renselaar
    Participant

    @nielsvanrenselaar

    It’s not that hard…

                                                                     $post-&gt;ID, "links" =&gt; array("edit" =&gt; bbp_get_reply_edit_link(), "trash" =&gt; bbp_get_reply_trash_link() ))); ?&gt;
    
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.