Skip to content

mastodon_api_get_notifications_query_args

Alex Kirk edited this page Aug 1, 2024 · 1 revision

Get the WP_Query arguments for fetching notifications.

Example

add_filter( 'mastodon_api_get_notifications_query_args', function( $args, $type ) {
    if ( $type === 'notification' ) {
        $args['post_type'] = 'notification';
    }
    return $args;
} );

Parameters

  • array $args WP_Query arguments.
  • string $type Type of notifications.
  • Enable_Mastodon_Apps\object $request Request object from WP.

Returns

array The modified WP_Query arguments.

Files

apply_filters(
				'mastodon_api_get_notifications_query_args',
				array(
					'post_type'      => Comment_CPT::CPT,
					'author__not_in' => array( get_current_user_id() ),
				),
				'mention',
				$request
			)

Hooks

Clone this wiki locally