Skip to content

mc_display_author

github-actions[bot] edited this page Jun 3, 2026 · 4 revisions

Filter the author parameter for a My Calendar view if set as 'current'. Default current user ID.

Auto-generated Example

add_filter(
   'mc_display_author',
    function(
        int $user_ID,
        string string
    ) {
        // Your code here.
        return $user_ID;
    },
    10,
    2
);

Parameters

  • int $user_ID Logged-in user ID.
  • string string $context 'today' to indicate the my_calendar_today shortcode is running. Other variable names: string $context 'upcoming' to indicate the my_calendar_upcoming shortcode is running., string $context 'main' to indicate the my_calendar shortcode is running., $main, $upcoming, $today

Returns

int Valid author ID.

Files

apply_filters( 'mc_display_author', $user_ID, 'main' )
apply_filters( 'mc_display_author', $user_ID, 'upcoming' )
apply_filters( 'mc_display_author', $user_ID, 'today' )

← All Hooks

Clone this wiki locally