Skip to:
Content

BuddyPress.org

Changeset 3307


Ignore:
Timestamp:
10/25/2010 08:56:34 PM (14 years ago)
Author:
djpaul
Message:

Add missing filters to edit/delete links on forum posts. Fixes #2617 (branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-forums/bp-forums-templatetags.php

    r3245 r3307  
    959959        global $topic_template;
    960960
    961         /* Never show for the first post in a topic. */
    962         if ( 0 == $topic_template->current_post && $topic_template->pag_page == 1 )
     961        // Never show for the first post in a topic.
     962        if ( 0 == $topic_template->current_post && 1 == $topic_template->pag_page )
    963963            return;
    964964
    965965        $defaults = array(
    966             'seperator' => '|'
     966            'separator' => ' | '
    967967        );
    968968
     
    970970        extract( $r, EXTR_SKIP );
    971971
     972        $query_vars = '';
    972973        if ( $_SERVER['QUERY_STRING'] )
    973974            $query_vars = '?' . $_SERVER['QUERY_STRING'];
    974975
    975         $links  = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a> ' . $seperator . ' ';
    976         $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a> | ';
    977 
    978         return $links;
     976        $links    = array();
     977        $links[]  = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a>';
     978        $links[] .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
     979
     980        return apply_filters( 'bp_get_the_topic_post_admin_links', implode( $separator, $links ), $links, $r );
    979981    }
    980982
Note: See TracChangeset for help on using the changeset viewer.