astra_get_author_id()

Function to get Author ID.


Description


Return

(mixed) $author_id Author ID.


Source

File: inc/blog/blog-config.php

function astra_get_author_id() {
	global $post;
	if ( isset( $post->post_author ) ) {
		$author_id = $post->post_author;
	} elseif ( is_callable( 'get_the_author_meta' ) ) {
		$author_id = get_the_author_meta( 'ID' );
	} else {
		$author_id = 1;
	}
	return $author_id;
}

Changelog

Changelog
Version Description
4.6.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.