Make WordPress Core

Ticket #14385: 14385.3.patch

File 14385.3.patch, 1.7 KB (added by Viper007Bond, 15 years ago)

Mature/unmature actions and add hooks to them as well as the spam actions (the other actions already have their own hooks)

  • wp-admin/ms-edit.php

     
    420420                if ( ! current_user_can( 'manage_sites' ) )
    421421                        wp_die( __( 'You do not have permission to access this page.' ) );
    422422
     423                do_action( 'unspam_blog', $id );
    423424                update_blog_status( $id, 'spam', '0' );
    424425                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unspam' ), wp_get_referer() ) );
    425426                exit();
     
    430431                if ( ! current_user_can( 'manage_sites' ) )
    431432                        wp_die( __( 'You do not have permission to access this page.' ) );
    432433
     434                do_action( 'spam_blog', $id );
    433435                update_blog_status( $id, 'spam', '1' );
    434436                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'spam' ), wp_get_referer() ) );
    435437                exit();
    436438        break;
    437439
     440        case 'unmatureblog':
     441                check_admin_referer( 'unmatureblog' );
     442                if ( ! current_user_can( 'manage_sites' ) )
     443                        wp_die( __( 'You do not have permission to access this page.' ) );
     444
     445                do_action( 'unmature_blog', $id );
     446                update_blog_status( $id, 'mature', '0' );
     447                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unmature' ), wp_get_referer() ) );
     448                exit();
     449        break;
     450
     451        case 'matureblog':
     452                check_admin_referer( 'matureblog' );
     453                if ( ! current_user_can( 'manage_sites' ) )
     454                        wp_die( __( 'You do not have permission to access this page.' ) );
     455
     456                do_action( 'mature_blog', $id );
     457                update_blog_status( $id, 'mature', '1' );
     458                wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'mature' ), wp_get_referer() ) );
     459                exit();
     460        break;
     461
    438462        // Themes
    439463    case 'updatethemes':
    440464        if ( ! current_user_can( 'manage_network_themes' ) )