Skip to content

Instantly share code, notes, and snippets.

@dancameron
Forked from anonymous/gist:ea942cb6bf5f48c875a7
Last active December 29, 2015 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancameron/14dd8e1c536abf8767ac to your computer and use it in GitHub Desktop.
Save dancameron/14dd8e1c536abf8767ac to your computer and use it in GitHub Desktop.
Getting client details for Dash
<?php
/* Template Name: Dashboard */
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
$client_ids = SI_Client::get_clients_by_user( $user_id );
if ( empty( $client_ids ) ) {
$client = Sprout_Client::get_instance( $client_ids[0] );
$phone = $client->get_phone();
}
get_header(); ?>
<section>
<article>
<h2>Welcome <?php echo $current_user->user_firstname; ?>!</h2>
</article>
<article>
</article>
</section>
<?php
if (get_field('add_sidebar')):
get_sidebar();
endif;
?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment