[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-nouveau/includes/messages/ -> template-tags.php (source)

   1  <?php
   2  /**
   3   * Messages template tags
   4   *
   5   * @since 3.0.0
   6   * @version 3.0.0
   7   */
   8  
   9  // Exit if accessed directly.
  10  defined( 'ABSPATH' ) || exit;
  11  
  12  /**
  13   * Fire specific hooks into the private messages template.
  14   *
  15   * @since 3.0.0
  16   *
  17   * @param string $when   Optional. Either 'before' or 'after'.
  18   * @param string $suffix Optional. Use it to add terms at the end of the hook name.
  19   */
  20  function bp_nouveau_messages_hook( $when = '', $suffix = '' ) {
  21      $hook = array( 'bp' );
  22  
  23      if ( $when ) {
  24          $hook[] = $when;
  25      }
  26  
  27      // It's a message hook
  28      $hook[] = 'message';
  29  
  30      if ( $suffix ) {
  31          if ( 'compose_content' === $suffix ) {
  32              $hook[2] = 'messages';
  33          }
  34  
  35          $hook[] = $suffix;
  36      }
  37  
  38      bp_nouveau_hook( $hook );
  39  }
  40  
  41  /**
  42   * Load the new Messages User Interface
  43   *
  44   * @since 3.0.0
  45   */
  46  function bp_nouveau_messages_member_interface() {
  47      /**
  48       * Fires before the member messages content.
  49       *
  50       * @since 1.2.0
  51       */
  52      do_action( 'bp_before_member_messages_content' );
  53  
  54      // Load the Private messages UI
  55      bp_get_template_part( 'common/js-templates/messages/index' );
  56  
  57      /**
  58       * Fires after the member messages content.
  59       *
  60       * @since 1.2.0
  61       */
  62      do_action( 'bp_after_member_messages_content' );
  63  }
  64  
  65  /**
  66   * Output the Member's messages search form.
  67   *
  68   * @since  3.0.0
  69   * @since  3.2.0 Move the function into Template Tags and use a template part.
  70   */
  71  function bp_nouveau_message_search_form() {
  72      $search_form_html = bp_buffer_template_part( 'common/js-templates/messages/search-form', null, false );
  73  
  74      /**
  75       * Filters the private message component search form.
  76       *
  77       * @since 2.2.0
  78       *
  79       * @param string $search_form_html HTML markup for the message search form.
  80       */
  81      echo apply_filters( 'bp_message_search_form', $search_form_html );
  82  }


Generated: Wed Dec 11 01:01:37 2019 Cross-referenced by PHPXref 0.7.1