Skip to:
Content

bbPress.org

Changeset 4255


Ignore:
Timestamp:
10/19/2012 12:50:06 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Topic and Reply Editing:

  • Fix issue with "Edit" admin links having 'view=all' argument incorrectly positioned.
  • Fix issue with post_status being set back to public when editing.
  • Conditionally set post_status to pending if needs moderation.
  • Fixes #1977.
Location:
trunk/bbp-includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbp-includes/replies/functions.php

    r4249 r4255  
    500500    // Maybe put into moderation
    501501    if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    502         $reply_status = bbp_get_pending_status_id();
    503 
    504     // Default
     502
     503        // Set post status to pending if public
     504        if ( bbp_get_public_status_id() == $reply->post_status ) {
     505            $reply_status = bbp_get_pending_status_id();
     506        }
     507
     508    // Use existing post_status
    505509    } else {
    506         $reply_status = bbp_get_public_status_id();
     510        $reply_status = $reply->post_status;
    507511    }
    508512
  • trunk/bbp-includes/replies/template-tags.php

    r4249 r4255  
    15721572            return;
    15731573
    1574         $reply_link = bbp_get_reply_permalink( $reply_id );
     1574        $reply_link = bbp_remove_view_all( bbp_get_reply_permalink( $reply_id ) );
    15751575
    15761576        // Pretty permalinks
     
    15831583            $url = add_query_arg( array( bbp_get_reply_post_type() => $reply->post_name, $bbp->edit_id => '1' ), $reply_link );
    15841584        }
     1585
     1586        // Maybe add view all
     1587        $url = bbp_add_view_all( $url );
    15851588
    15861589        return apply_filters( 'bbp_get_reply_edit_url', $url, $reply_id );
  • trunk/bbp-includes/topics/functions.php

    r4249 r4255  
    556556    // Maybe put into moderation
    557557    if ( !bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) {
    558         $topic_status = bbp_get_pending_status_id();
    559 
    560     // Default to published
     558
     559        // Set post status to pending if public or closed
     560        if ( in_array( $topic->post_status, array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ) ) {
     561            $topic_status = bbp_get_pending_status_id();
     562        }
     563
     564    // Use existing post_status
    561565    } else {
    562         $topic_status = bbp_get_public_status_id();
     566        $topic_status = $topic->post_status;
    563567    }
    564568
  • trunk/bbp-includes/topics/template-tags.php

    r4249 r4255  
    23002300            return;
    23012301
    2302         $topic_link = bbp_get_topic_permalink( $topic_id );
     2302        // Remove view=all link from edit
     2303        $topic_link = bbp_remove_view_all( bbp_get_topic_permalink( $topic_id ) );
    23032304
    23042305        // Pretty permalinks
     
    23112312            $url = add_query_arg( array( bbp_get_topic_post_type() => $topic->post_name, $bbp->edit_id => '1' ), $topic_link );
    23122313        }
     2314
     2315        // Maybe add view=all
     2316        $url = bbp_add_view_all( $url );
    23132317
    23142318        return apply_filters( 'bbp_get_topic_edit_url', $url, $topic_id );
Note: See TracChangeset for help on using the changeset viewer.