Making WordPress.org

Changeset 3783


Ignore:
Timestamp:
08/08/2016 08:15:21 PM (10 years ago)
Author:
jmdodd
Message:

Support: Add yes/no/mu views to Topic Resolution.

See #1544, #1873.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-resolution/inc/class-plugin.php

    r3746 r3783  
    66
    77        /**
    8          * @todo Views: yes/no/mu -- all available for all enabled forums
    98         * @todo Edit enabled forums - will need to be updateable from the admin interface for administrators during forum setup
    10          * @todo Add topic title filter
    119         * Decisions: default topic resolution is 'no'
    1210         */
     
    5250                add_action( 'bbp_new_topic_post_extras', array( $this, 'topic_post_extras' ) );
    5351                add_action( 'bbp_edit_topic_post_extras', array( $this, 'topic_post_extras' ) );
     52
     53                // Register views.
     54                add_action( 'bbp_register_views', array( $this, 'register_views' ) );
    5455
    5556                // Indicate if the forum is a support forum.
     
    151152                        'resolution' => $resolution,
    152153                ) );
     154        }
     155
     156        /**
     157         * Register resolution state views.
     158         */
     159        public function register_views() {
     160                // Not a support topic.
     161                bbp_register_view(
     162                        'support-forum-mu',
     163                        __( 'Non-support topics', 'wporg-forums' ),
     164                        apply_filters( 'wporg_bbp_topic_resolution_view_non_support', array(
     165                                'meta_key'      => 'topic_resolved',
     166                                'meta_type'     => 'CHAR',
     167                                'meta_value'    => 'mu',
     168                                'meta_compare'  => '=',
     169                                'orderby'       => '',
     170                                'show_stickies' => false,
     171                        ) )
     172                );
     173
     174                // Resolved.
     175                bbp_register_view(
     176                        'support-forum-yes',
     177                        __( 'Resolved topics', 'wporg-forums' ),
     178                        apply_filters( 'wporg_bbp_topic_resolution_view_resolved', array(
     179                                'meta_key'      => 'topic_resolved',
     180                                'meta_type'     => 'CHAR',
     181                                'meta_value'    => 'yes',
     182                                'meta_compare'  => '=',
     183                                'orderby'       => '',
     184                                'show_stickies' => false,
     185                        ) )
     186                );
     187
     188                // Unresolved.
     189                bbp_register_view(
     190                        'support-forum-no',
     191                        __( 'Unresolved topics', 'wporg-forums' ),
     192                        apply_filters( 'wporg_bbp_topic_resolution_view_unresolved', array(
     193                                'meta_key'      => 'topic_resolved',
     194                                'meta_type'     => 'CHAR',
     195                                'meta_value'    => 'no',
     196                                'meta_compare'  => '=',
     197                                'orderby'       => '',
     198                                'show_stickies' => false,
     199                        ) )
     200                );
    153201        }
    154202
Note: See TracChangeset for help on using the changeset viewer.