Make WordPress Core

Changeset 15836


Ignore:
Timestamp:
10/18/2010 06:53:47 PM (16 years ago)
Author:
ryan
Message:

Allow flagging of a blog as mature via a URL. Move some actions into update_blog_status(). Props Viper007Bond. fixes #14385

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/edit.php

    r15830 r15836  
    399399
    400400                update_blog_status( $id, 'archived', '1' );
    401                 do_action( 'archive_blog', $id );
    402401                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'archive' ), wp_get_referer() ) );
    403402                exit();
    … …  
    409408                        wp_die( __( 'You do not have permission to access this page.' ) );
    410409
    411                 do_action( 'unarchive_blog', $id );
    412410                update_blog_status( $id, 'archived', '0' );
    413411                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unarchive' ), wp_get_referer() ) );
    … …  
    454452                update_blog_status( $id, 'spam', '1' );
    455453                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'spam' ), wp_get_referer() ) );
     454                exit();
     455        break;
     456
     457        case 'unmatureblog':
     458                check_admin_referer( 'unmatureblog' );
     459                if ( ! current_user_can( 'manage_sites' ) )
     460                        wp_die( __( 'You do not have permission to access this page.' ) );
     461
     462                update_blog_status( $id, 'mature', '0' );
     463                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unmature' ), wp_get_referer() ) );
     464                exit();
     465        break;
     466
     467        case 'matureblog':
     468                check_admin_referer( 'matureblog' );
     469                if ( ! current_user_can( 'manage_sites' ) )
     470                        wp_die( __( 'You do not have permission to access this page.' ) );
     471
     472                update_blog_status( $id, 'mature', '1' );
     473                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'mature' ), wp_get_referer() ) );
    456474                exit();
    457475        break;
  • trunk/wp-includes/ms-blogs.php

    r15756 r15836  
    629629                refresh_blog_details($blog_id);
    630630
    631         if ( $pref == 'spam' ) {
    632                 if ( $value == 1 )
    633                         do_action( "make_spam_blog", $blog_id );
    634                 else
    635                         do_action( "make_ham_blog", $blog_id );
    636         }
     631        if ( 'spam' == $pref )
     632                ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) :     do_action( 'make_ham_blog', $blog_id );
     633        elseif ( 'mature' == $pref )
     634                ( $value == 1 ) ? do_action( 'mature_blog', $blog_id ) : do_action( 'unmature_blog', $blog_id );
     635        elseif ( 'archived' == $pref )
     636                ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id );
     637        elseif ( 'archived' == $pref )
     638                ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id );
    637639
    638640        return $value;
Note: See TracChangeset for help on using the changeset viewer.