\WP_Stager_Integration\Event::get_status_label(string $status): string

Description

Gets the status label for an event.

Parameters:

ParameterTypeDescription
$status string The event status.

Returns:

string The status label. Returns an empty string if no label is found for the passed status.

Information

Fileclass-event.php line 1137

Full Code

/**
 * Gets the status label for an event.
 *
 * @param string $status The event status.
 *
 * @return string The status label. Returns an empty string if no label is found for the passed status.
 */
public static function get_status_label( $status ) {

    // Type casting
    $status = (string) $status;

    // Init
    $status_label = '';

    switch ( $status ) {

        case Options::STAGER_EVENT_STATUS_CONFIRMED:
            $status_label = _x( 'Confirmed', 'An event status', 'wp-stager-integration' );
            break;

        case Options::STAGER_EVENT_STATUS_TO_BE_CANCELLED:
            $status_label = _x( 'To be cancelled', 'An event status', 'wp-stager-integration' );
            break;

        case Options::STAGER_EVENT_STATUS_CANCELLED:
            $status_label = _x( 'Cancelled', 'An event status', 'wp-stager-integration' );
            break;

        case Options::STAGER_EVENT_STATUS_TO_BE_CONFIRMED:
            $status_label = _x( 'To be confirmed', 'An event status', 'wp-stager-integration' );
            break;

        case Options::STAGER_EVENT_STATUS_OPTION:
            $status_label = _x( 'Option', 'An event status', 'wp-stager-integration' );
            break;
    }

    return $status_label;
}

💡 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!