| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
if( ! empty( $heading ) ) { |
| 6 |
?><h2><?php echo esc_html( $heading ); ?></h2><?php |
| 7 |
} |
| 8 |
if ( ! fep_current_user_can( 'send_new_message_to', $to_id ) ) { |
| 9 |
echo '<div class="fep-error">' . esc_html__( 'You do not have permission to send message to this receiver!', 'front-end-pm' ) . '</div>'; |
| 10 |
} elseif ( isset( $_POST['fep_action'] ) && 'shortcode-newmessage' == $_POST['fep_action'] ) { |
| 11 |
if ( fep_errors()->get_error_messages() ) { |
| 12 |
echo Fep_Form::init()->form_field_output( 'shortcode-newmessage', fep_errors(), array( 'message_to' => $to ) ); |
| 13 |
} else { |
| 14 |
echo fep_info_output(); |
| 15 |
} |
| 16 |
} else { |
| 17 |
echo Fep_Form::init()->form_field_output( 'shortcode-newmessage', '', array( 'message_to' => $to, 'message_title' => $subject ) ); |
| 18 |
} |
| 19 |
|