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
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | 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