[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-legacy/buddypress/activity/ -> post-form.php (source)

   1  <?php
   2  /**
   3   * BuddyPress - Activity Post Form
   4   *
   5   * @package BuddyPress
   6   * @subpackage bp-legacy
   7   * @version 3.0.0
   8   */
   9  
  10  ?>
  11  
  12  <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form">
  13  
  14      <?php
  15  
  16      /**
  17       * Fires before the activity post form.
  18       *
  19       * @since 1.2.0
  20       */
  21      do_action( 'bp_before_activity_post_form' ); ?>
  22  
  23      <div id="whats-new-avatar">
  24          <a href="<?php echo bp_loggedin_user_domain(); ?>">
  25              <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
  26          </a>
  27      </div>
  28  
  29      <p class="activity-greeting">
  30          <?php
  31          if ( bp_is_group() ) {
  32              /* translators: 1: group name. 2: member name. */
  33              printf( __( 'What\'s new in %1$s, %2$s?', 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
  34          } else {
  35              /* translators: %s: member name */
  36              printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
  37          }
  38          ?>
  39      </p>
  40  
  41      <div id="whats-new-content">
  42          <div id="whats-new-textarea">
  43              <label for="whats-new" class="bp-screen-reader-text"><?php
  44                  /* translators: accessibility text */
  45                  _e( 'Post what\'s new', 'buddypress' );
  46              ?></label>
  47              <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
  48                  <?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?>
  49              ><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
  50          </div>
  51  
  52          <div id="whats-new-options">
  53              <div id="whats-new-submit">
  54                  <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" />
  55              </div>
  56  
  57              <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
  58  
  59                  <div id="whats-new-post-in-box">
  60  
  61                      <?php _e( 'Post in', 'buddypress' ); ?>:
  62  
  63                      <label for="whats-new-post-in" class="bp-screen-reader-text"><?php
  64                          /* translators: accessibility text */
  65                          _e( 'Post in', 'buddypress' );
  66                      ?></label>
  67                      <select id="whats-new-post-in" name="whats-new-post-in">
  68                          <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
  69  
  70                          <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) :
  71                              while ( bp_groups() ) : bp_the_group(); ?>
  72  
  73                                  <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
  74  
  75                              <?php endwhile;
  76                          endif; ?>
  77  
  78                      </select>
  79                  </div>
  80                  <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
  81  
  82              <?php elseif ( bp_is_group_activity() ) : ?>
  83  
  84                  <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
  85                  <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
  86  
  87              <?php endif; ?>
  88  
  89              <?php
  90  
  91              /**
  92               * Fires at the end of the activity post form markup.
  93               *
  94               * @since 1.2.0
  95               */
  96              do_action( 'bp_activity_post_form_options' ); ?>
  97  
  98          </div><!-- #whats-new-options -->
  99      </div><!-- #whats-new-content -->
 100  
 101      <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
 102      <?php
 103  
 104      /**
 105       * Fires after the activity post form.
 106       *
 107       * @since 1.2.0
 108       */
 109      do_action( 'bp_after_activity_post_form' ); ?>
 110  
 111  </form><!-- #whats-new-form -->


Generated: Wed Aug 5 01:01:31 2020 Cross-referenced by PHPXref 0.7.1