Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/06/2015 11:42:53 PM (9 years ago)
Author:
r-a-y
Message:

Messages: Introduce starring private messages feature.

This commit:

  • Registers the 'star' feature into the BP Messages component and dynamically loads the bp-messages-star.php file if the feature is active. By default, the feature is active, but can be disabled with the following snippet: 'bp_is_messages_star_active', '__return_false' );
  • Adds a 'Starred' box to the messages user subnav
  • Adds an icon to star or unstar a message in a message or message thread loop
  • Adds the 'Add star' and 'Remove star' options to the message thread 'Bulk Actions' dropdown menu
  • Adds accompanying CSS and JS to the bp-legacy template pack.

Fixes #6331.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-loader.php

    r9825 r9846  
    4040            buddypress()->plugin_dir,
    4141            array(
    42                 'adminbar_myaccount_order' => 50
     42                'adminbar_myaccount_order' => 50,
     43                'features'                 => array( 'star' )
    4344            )
    4445        );
     
    6869        );
    6970
     71        // Conditional includes
     72        if ( bp_is_active( $this->id, 'star' ) ) {
     73            $includes[] = 'star';
     74        }
     75
    7076        parent::includes( $includes );
    7177    }
     
    167173        );
    168174
     175        if ( bp_is_active( $this->id, 'star' ) ) {
     176            $sub_nav[] = array(
     177                'name'            => __( 'Starred', 'buddypress' ),
     178                'slug'            => bp_get_messages_starred_slug(),
     179                'parent_url'      => $messages_link,
     180                'parent_slug'     => $this->slug,
     181                'screen_function' => 'bp_messages_star_screen',
     182                'position'        => 11,
     183                'user_has_access' => bp_core_can_edit_settings()
     184            );
     185        }
     186
    169187        $sub_nav[] = array(
    170188            'name'            => __( 'Sent', 'buddypress' ),
     
    243261                'href'   => trailingslashit( $messages_link . 'inbox' )
    244262            );
     263
     264            // Starred
     265            if ( bp_is_active( $this->id, 'star' ) ) {
     266                $wp_admin_nav[] = array(
     267                    'parent' => 'my-account-' . $this->id,
     268                    'id'     => 'my-account-' . $this->id . '-starred',
     269                    'title'  => __( 'Starred', 'buddypress' ),
     270                    'href'   => trailingslashit( $messages_link . bp_get_messages_starred_slug() )
     271                );
     272            }
    245273
    246274            // Sent Messages
Note: See TracChangeset for help on using the changeset viewer.