PluginProbe
Friends / 4.3.0
Friends v4.3.0
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / templates / frontend / messages / message-form.php

message-form.php in Friends 4.3.0, at templates/frontend/messages/message-form.php

101 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This template contains the send message form on /friends/.
4 *
5 * @package Friends
6 */
7
8 if ( ! isset( $args['subject'] ) && ! isset( $args['reply_to'] ) ) {
9 ?>
10 <div class="card mt-2 p-2" id="friends-send-new-message" style="display: none">
11 <?php
12 }
13
14 $draft_key = implode(
15 ':',
16 array(
17 'friends-message-draft',
18 get_current_user_id(),
19 $args['friend_user']->user_login,
20 isset( $args['reply_to'] ) ? 'reply-' . absint( $args['reply_to'] ) : 'new',
21 )
22 );
23 ?>
24 <form method="post" class="form-horizontal" data-friends-message-draft-key="<?php echo esc_attr( $draft_key ); ?>">
25 <input type="hidden" name="friends_message_recipient" value="<?php echo esc_attr( $args['friend_user']->user_login ); ?>">
26 <?php if ( isset( $args['reply_to'] ) ) : ?>
27 <input type="hidden" name="friends_message_reply_to" value="<?php echo esc_attr( $args['reply_to'] ); ?>">
28 <?php endif; ?>
29 <?php if ( ! empty( $args['redirect_to'] ) ) : ?>
30 <input type="hidden" name="friends_message_redirect_to" value="<?php echo esc_url( $args['redirect_to'] ); ?>">
31 <?php endif; ?>
32 <?php wp_nonce_field( 'friends_send_message' ); ?>
33 <div class="form-group">
34 <div class="col-2 col-sm-12">
35 <label class="form-label" for="friend_message_to"><?php esc_html_e( 'To', 'friends' ); ?></label>
36 </div>
37 <div class="col-8 col-sm-12">
38 <?php if ( count( $args['accounts'] ) > 1 ) : ?>
39 <select name="friends_message_account" id="friend_message_to">
40 <?php foreach ( $args['accounts'] as $url => $name ) : ?>
41 <option value="<?php echo esc_attr( $url ); ?>"><?php echo esc_html( $name ); ?></option>
42 <?php endforeach; ?>
43 </select>
44 <?php else : ?>
45 <input type="hidden" name="friends_message_account" value="<?php echo esc_attr( key( $args['accounts'] ) ); ?>">
46 <span id="friend_message_to"><?php echo esc_html( reset( $args['accounts'] ) ); ?></span>
47 <?php endif; ?>
48 </div>
49 </div>
50 <?php if ( isset( $args['subject'] ) ) : ?>
51 <input type="hidden" name="friends_message_subject" value="<?php echo esc_attr( $args['subject'] ); ?>">
52 <?php else : ?>
53 <div class="form-group">
54 <div class="col-2 col-sm-12">
55 <label class="form-label" for="subject"><?php esc_html_e( 'Subject', 'friends' ); ?></label>
56 </div>
57 <div class="col-8 col-sm-12">
58 <?php if ( isset( $args['subject'] ) && $args['subject'] ) : ?>
59 <input type="hidden" name="friends_message_subject" value="<?php echo esc_attr( $args['subject'] ); ?>" />
60 <?php else : ?>
61 <input class="form-input" type="text" name="friends_message_subject" value="" placeholder="<?php esc_attr_e( 'Subject (optional)', 'friends' ); ?>" />
62 <?php endif; ?>
63 </div>
64 </div>
65 <?php endif; ?>
66
67 <div class="form-group">
68 <div class="col-2 col-sm-12">
69 <label class="form-label" for="friends_message_message"><?php esc_html_e( 'Message', 'friends' ); ?></label>
70 </div>
71 <div class="col-8 col-sm-12<?php echo esc_attr( $args['blocks-everywhere'] ? ' blocks-everywhere iso-editor__loading' : '' ); ?>">
72 <textarea class="form-input friends-message-message<?php echo esc_attr( $args['blocks-everywhere'] ? ' blocks-everywhere-enabled' : '' ); ?>" name="friends_message_message" placeholder="" rows="3"></textarea>
73 <?php
74 do_action( 'friends_message_form' );
75 ?>
76 </div>
77 </div>
78 <div class="form-group">
79 <div class="col-2 col-sm-12">
80 </div>
81 <div class="<?php echo esc_attr( ! empty( $args['reply_to'] ) ? 'col-4' : 'col-6' ); ?> col-sm-12">
82 <button class="btn"><?php esc_html_e( 'Send', 'friends' ); ?></button>
83 </div>
84 <?php
85 if ( ! empty( $args['reply_to'] ) ) {
86 ?>
87 <div class="col-4 col-sm-12" style="text-align: right">
88 <button class="btn btn-link btn-sm delete-conversation text-error" name="friends_message_delete_conversation"><?php esc_html_e( 'Delete conversation', 'friends' ); ?></button>
89 </div>
90 <?php
91 }
92 ?>
93 </div>
94 </form>
95 <?php
96 if ( ! isset( $args['subject'] ) ) {
97 ?>
98 </div>
99 <?php
100 }
101