mycred_rank_has_logo
Description
This function checks if a given rank has a logo using the has_post_thumbnail function.
This function is only available if the Ranks add-on is enabled.
Available since version 1.0
Returns
(bool) Returns TRUE
if the rank has a logo else FALSE
.
Parameters
Param | Type | Required | Description | |
---|---|---|---|---|
function mycred_rank_has_logo( |
||||
$rank_identifier |
int or string | Yes | Either the ranks post object ID or the ranks exact name. |
|
) { ... } |
Examples
Example 1: Get the current users rank and check if the rank has a logo.
$user_id = get_current_user_id(); $rank_id = mycred_get_users_rank( $user_id ); if ( mycred_rank_has_logo( $rank_id ) ) { // Rank has logo }