AnsPress_Theme::ap_before_html_body()

Description #

Add default before body sidebar in AnsPress contents

Source #

File: includes/class-theme.php

	public static function ap_before_html_body() {
		if ( is_user_logged_in() ) {
			$current_user = wp_get_current_user();
			$data         = array(
				'user_login'   => $current_user->data->user_login,
				'display_name' => $current_user->data->display_name,
				'user_email'   => $current_user->data->user_email,
				'avatar'       => get_avatar( $current_user->ID ),
			);
			?>
				<script type="text/javascript">
					apCurrentUser = <?php echo wp_json_encode( $data ); ?>;
				</script>
			<?php
		}
		dynamic_sidebar( 'ap-before' );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment