Advertisement
buddydev

Untitled

Dec 5th, 2024
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.51 KB | None | 0 0
  1. <?php
  2. /**
  3.  * BuddyPress - Activity Post Form
  4.  *
  5.  * @package BuddyPress
  6.  * @subpackage bp-legacy
  7.  * @version 3.0.0
  8.  */
  9.  
  10. // @codingStandardsIgnoreFile
  11. // Allow plugin text domain in theme.
  12. ?>
  13. <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" class="card card-static">
  14.  
  15.     <?php do_action( 'bp_before_activity_post_form' ); ?>
  16.  
  17.     <div class="whats-new-form-content d-flex">
  18.  
  19.         <div id="whats-new-avatar" class="d-none d-md-flex align-self-start">
  20.  
  21.             <a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>">
  22.                 <?php bp_loggedin_user_avatar(); ?>
  23.             </a>
  24.  
  25.         </div> <!-- #whats-new-avatar -->
  26.  
  27.         <div class="media-body">
  28.  
  29.             <?php $active_class = empty( $_GET['r'] ) ? '' : 'active'; ?>
  30.  
  31.             <div id="whats-new-content" class="<?php echo esc_attr( $active_class ); ?>">
  32.  
  33.                 <div id="whats-new-textarea" class="<?php echo esc_attr( $active_class ); ?>">
  34.                     <?php
  35.                     /* translators: %s: User name */
  36.                     $placeholder = sprintf( esc_html__( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
  37.  
  38.                     if ( bp_is_group() ) :
  39.                         /* translators: 1: The group name, 2: The user name */
  40.                         $placeholder = sprintf( esc_html__( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
  41.                     endif; ?>
  42.                     <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10" placeholder="<?php echo esc_attr( $placeholder ); ?>" <?php echo bp_is_group() ? 'data-suggestions-group-id="' . esc_attr( (int) bp_get_current_group_id() ) . '"' : ''; ?>><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( wp_unslash( $_GET['r'] ) ); ?> <?php endif; ?></textarea>
  43.                 </div>
  44.  
  45.                 <div id="whats-new-options" class="element-animated fade-in short">
  46.  
  47.                     <?php if ( bp_is_active( 'groups' ) && ! bp_is_my_profile() && ! bp_is_group() ) : ?>
  48.  
  49.                         <div id="whats-new-post-in-box">
  50.                             <select id="whats-new-post-in" name="whats-new-post-in">
  51.                                 <option selected="selected" value="0"><?php esc_html_e( 'My Profile', 'buddypress' ); ?></option>
  52.  
  53.                                 <?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' ) ) :
  54.                                     while ( bp_groups() ) : bp_the_group(); ?>
  55.  
  56.                                         <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
  57.  
  58.                                     <?php endwhile;
  59.                                 endif; ?>
  60.  
  61.                             </select>
  62.                         </div>
  63.                         <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
  64.  
  65.                     <?php elseif ( bp_is_group_activity() ) : ?>
  66.  
  67.                         <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
  68.                         <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
  69.  
  70.                     <?php endif; ?>
  71.  
  72.                     <div id="whats-new-submit">
  73.                         <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" class="mr-0" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" />
  74.                     </div>
  75.  
  76.                     <div class="clear"></div>
  77.  
  78.  
  79.                     <?php do_action( 'bp_activity_post_form_options' ); ?>
  80.  
  81.                 </div><!-- #whats-new-options -->
  82.  
  83.  
  84.             </div><!-- #whats-new-content -->
  85.  
  86.         </div> <!-- .media-body -->
  87.  
  88.     </div> <!-- .media -->
  89.  
  90.     <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
  91.  
  92.     <?php do_action( 'bp_after_activity_post_form' ); ?>
  93.  
  94. </form> <!-- #whats-new-form -->
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement