ap_get_author_avatar( integer $size = 45, mixed $_post = null )
Description #
Return question author avatar.
Parameters #
- $sizeinteger (Optional) Avatar size. Default value: 45
- $_postmixed (Optional) Post. Default value: null
Source #
File: includes/qaquery.php
function ap_get_author_avatar( $size = 45, $_post = null ) { $_post = ap_get_post( $_post ); if ( ! $_post ) { return; } $author = 0 == $_post->post_author ? 'anonymous_' . $_post->ID : $_post->post_author; // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual if ( false !== strpos( $author, 'anonymous' ) && is_array( $_post->fields ) && ! empty( $_post->fields['anonymous_name'] ) ) { $author = $_post->fields['anonymous_name']; } return get_avatar( $author, $size ); }
Expand full source code Collapse full source code View on GitHub: includes/qaquery.php:354
Add your comment