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