Making WordPress.org

Ticket #1561: meta-1561.patch

File meta-1561.patch, 2.5 KB (added by SergeyBiryukov, 8 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/functions.php

     
    193193        return ( WordPressdotorg\Forums\Plugin::REVIEWS_FORUM_ID == bbp_get_topic_forum_id() );
    194194}
    195195
     196/**
     197 * Display a notice for messages caught in the moderation queue.
     198 */
     199function wporg_support_add_moderation_notice() {
     200        $post_time       = mysql2date( 'U', get_post_field( 'post_date', get_the_ID() ) );
     201        $seconds_passed  = current_time( 'timestamp' ) - $post_time;
     202        $hours_passed    = (int) ( $seconds_passed / HOUR_IN_SECONDS );
     203        $is_user_blocked = ! current_user_can( 'spectate' );
     204?>
     205
     206        <?php if ( in_array( get_post_status(), array( 'pending', 'spam' ) ) ) : ?>
     207
     208                <div class="bbp-template-notice">
     209                        <p><?php _e( 'This post has been held for moderation by our automated system. It will be reviewed within 72 hours.', 'wporg-forums' ); ?></p>
     210                </div>
     211
     212                <?php if ( ! $is_user_blocked && $hours_passed > 96 ) : ?>
     213
     214                        <div class="bbp-template-notice warning">
     215                                <p><?php
     216                                        printf(
     217                                                /* translators: https://make.wordpress.org/chat/ */
     218                                                __( 'If this message is not yet approved, please come to the #forums channel on <a href="%s">WordPress Slack</a> and let us know. Provide a link to the post.', 'wporg-forums' ),
     219                                                'https://make.wordpress.org/chat/'
     220                                        );
     221                                ?></p>
     222                        </div>
     223
     224                <?php endif; ?>
     225
     226        <?php endif; ?>
     227
     228<?php
     229}
     230add_action( 'bbp_theme_before_topic_content', 'wporg_support_add_moderation_notice' );
     231add_action( 'bbp_theme_before_reply_content', 'wporg_support_add_moderation_notice' );
     232
    196233/** bb Base *******************************************************************/
    197234
    198235function bb_base_search_form() {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/style.css

     
    161161        list-style: disc;
    162162}
    163163
     164.bbp-topic-content div.bbp-template-notice,
     165.bbp-reply-content div.bbp-template-notice {
     166        display: inline-block;
     167}
     168
    164169/* Reply button */
    165170div.bbp-submit-wrapper {
    166171        float: none;