HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpprotonperinggit/wp-content/themes/voiture/widgets/private-message-form.php
<?php

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
extract( $args );
global $post;
if ( !empty($post->post_type) && $post->post_type == 'listing' ) {
	
		$author_name = get_the_author_meta('display_name');

	extract( $args );
	extract( $instance );
	echo trim($before_widget);
	$title = !empty($instance['title']) ? sprintf($instance['title'], $author_name) : '';
	$title = apply_filters('widget_title', $title);

	if ( $title ) {
	    echo trim($before_title)  . trim( $title ) . $after_title;
	}

	$rand_id = voiture_random_key();
	?>
		<div class="contact-form-agent">
		    <?php
			if ( is_user_logged_in() ) {
				?>
				<form id="send-message-form" class="send-message-form form-theme" action="?" method="post">
	                <div class="form-group">
	                    <input id="send-message-form-subject-<?php echo esc_attr($rand_id); ?>" type="text" class="form-control" name="subject" required="required">
	                    <label for="send-message-form-subject-<?php echo esc_attr($rand_id); ?>" class="for-control"><?php esc_attr_e( 'Subject', 'voiture' ); ?></label>
	                </div><!-- /.form-group -->
	                <div class="form-group">
	                    <textarea id="send-message-form-message-<?php echo esc_attr($rand_id); ?>" class="form-control" name="message" required="required"></textarea>
	                    <label for="send-message-form-message-<?php echo esc_attr($rand_id); ?>" class="for-control"><?php esc_attr_e( 'Enter text here...', 'voiture' ); ?></label>
	                </div><!-- /.form-group -->

	                <?php wp_nonce_field( 'wp-private-message-send-message', 'wp-private-message-send-message-nonce' ); ?>
	              	<input type="hidden" name="recipient" value="<?php echo esc_attr($user_id); ?>">
	              	<input type="hidden" name="action" value="wp_private_message_send_message">
	                <button class="button btn btn-theme btn-block send-message-btn"><?php echo esc_html__( 'Send Message', 'voiture' ); ?></button>
	        	</form>
				<?php
			} else {
				$login_url = '';
				if ( function_exists('wp_cardealer_get_option') ) {
					$login_register_page_id = wp_cardealer_get_option('login_register_page_id');
					$login_url = get_permalink( $login_register_page_id );
				}
				?>
				<a href="<?php echo esc_url($login_url); ?>" class="login"><?php esc_html_e('Please login to send a private message', 'voiture'); ?></a>
				<?php
			}
			?>
		</div>
		<?php echo trim($after_widget);
}