\WP_Stager_Integration\Calendar::_async_get_calendar_html(array $args): void

Description

Internal helper to render async calendars.

Parameters:

ParameterTypeDescription
$args array The arguments to pass to the \WP_Stager_Integration\Calendar::render_calendar() method.

Returns:

void

Information

Fileclass-calendar.php line 1544
See also

Full Code

/**
 * Internal helper to render async calendars.
 *
 * @param array $args   The arguments to pass to the <code>\WP_Stager_Integration\Calendar::render_calendar()</code> method.
 *
 * @return void
 *
 * @see \WP_Stager_Integration\Calendar::render_calendar() for accepted <code>$args</code>.
 */
public static function _async_get_calendar_html( $args ) {

    // Type casting
    $args = (array) $args;

    // Set async to false
    $args[ 'async' ] = false;

    // Get data
    $scope   = (string) ($args[ 'scope' ] ?? '');
    $context = (string) ($args[ 'context' ] ?? '');

    ob_start();

    if ( 'block-editor' === $context ) {

        switch ( $scope ) {

            case 'all':
                self::render_all( $args );
                break;

            case 'currently_happening':
                self::render_currently_happening( $args );
                break;

            case 'day':
                self::render_day( null, null, null, $args );
                break;

            case 'week':
                self::render_week( null, null, $args );
                break;

            case 'month':
                self::render_month( null, null, $args );
                break;

            case 'year':
                self::render_year( null, $args );
                break;

            default:
                self::render_calendar( $args );
                break;
        }
    } else {
        self::render_calendar( $args );
    }

    return ob_get_clean();
}

💡 If you ever get stuck or have a question, please check our FAQs, our Free Integration Service, our paid Full Integration Service, or reach out to us!

Get WP Stager Integration

🎁 Limited offer: Use code WELCOME26 to get your first month for free!