mycred_count_ref_instances

Codex / mycred/log / Functions / mycred_count_ref_instances

Navigation:

  1. Description
  2. Usage
  3. Parameters
  4. Return

Description

This function counts the total number of occurrences a given reference is used in the log either overall or for a specific user.

 

Usage

if ( mycred_count_ref_instances( $reference, $user_id ) > 0 ) {
	// this user has a log entry with the given reference
}

 

Parameters

  • reference (string) required
    The reference to search for. Note this is case sensitive.
  • user_id (int)
    Optional user id to include in the search. Defaults to not used.

 

Return

This function returns the number of times the reference is used in the log. Zero if no records are found or if reference was not set.

Last edited March 5, 2016