Create Client Info section in the Site Info widget

If you want to add some custom client info in the Site Info widget, for example

You can use the client data that you have set for the Pro Reports (or Client Reports) extension. Here is one very basic example:

add_action( 'mainwp_site_info_widget_bottom', 'mycustom_site_info_table' );
function mycustom_site_info_table( $website ) {
	$tokens = apply_filters( 'mainwp_pro_reports_get_site_tokens', false,  $website->id );
	?>
	<div class="ui hidden divider"></div>
	<div class="ui header">Client Info</div>
	<div class="ui hidden divider"></div>
	<table class="ui celled striped table">
		<tbody>
			<tr>
				<td>Client Name</td><td><?php echo $tokens['[client.name]']; ?></td>		
			</tr>
			<tr>
				<td>Client Email</td><td><?php echo $tokens['[client.email]']; ?></td>		
			</tr>
			<tr>
				<td>Client Phone</td><td><?php echo $tokens['[client.phone]']; ?></td>		
			</tr>
		</tbody>
	</table>
	<?php
}

and if you are using the Client Reports extension:

add_action( 'mainwp_site_info_widget_bottom', 'mycustom_site_info_table' );
function mycustom_site_info_table( $website ) {
	$tokens = apply_filters( 'mainwp_client_report_get_site_tokens', false,  $website->id );
	?>
	<div class="ui hidden divider"></div>
	<div class="ui header">Client Info</div>
	<div class="ui hidden divider"></div>
	<table class="ui celled striped table">
		<tbody>
			<tr>
				<td>Client Name</td><td><?php echo $tokens['[client.name]']; ?></td>		
			</tr>
			<tr>
				<td>Client Email</td><td><?php echo $tokens['[client.email]']; ?></td>		
			</tr>
			<tr>
				<td>Client Phone</td><td><?php echo $tokens['[client.phone]']; ?></td>		
			</tr>
		</tbody>
	</table>
	<?php
}
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.