<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$codes = array(
    array(
        'code'        => '{category_name}',
        'description' => __( 'name of category', 'bookly' ),
    ),
    array(
        'code'        => '{login_form}',
        'description' => __( 'login form', 'bookly' ),
        'step'        => 5,
        'login'       => true,
    ),
    array(
        'code'        => '{number_of_persons}',
        'description' => __( 'number of persons', 'bookly' ),
    ),
    array(
        'code'        => '{booking_number}',
        'description' => __( 'booking number', 'bookly' ),
        'step'        => 7,
    ),
    array(
        'code'        => '{service_date}',
        'description' => __( 'date of service', 'bookly' ),
        'min_step'    => 3,
    ),
    array(
        'code'        => '{service_info}',
        'description' => __( 'info of service', 'bookly' ),
    ),
    array(
        'code'        => '{service_name}',
        'description' => __( 'name of service', 'bookly' ),
    ),
    array(
        'code'        => '{service_price}',
        'description' => __( 'price of service', 'bookly' ),
    ),
    array(
        'code'        => '{service_time}',
        'description' => __( 'time of service', 'bookly' ),
        'min_step'    => 3,
    ),
    array(
        'code'        => '{staff_info}',
        'description' => __( 'info of staff', 'bookly' ),
    ),
    array(
        'code'        => '{staff_name}',
        'description' => __( 'name of staff', 'bookly' ),
    ),
    array(
        'code'        => '{total_price}',
        'description' => __( 'total price of booking', 'bookly' ),
    ),
);

$codes = apply_filters( 'bookly_appearance_short_codes', $codes );

uasort( $codes, function ( $code_a, $code_b ) {
    return ( $code_a['code'] < $code_b['code'] ) ? - 1 : 1;
} );

foreach ( $codes as $code ) {
    if ( empty( $code['step'] ) || $step == $code['step'] ) {
        if ( empty( $code['min_step'] ) || $step > $code['min_step'] ) {
            if ( empty( $code['login'] ) || $login ) {
                echo '<b>' . $code['code'] . '</b> - ' . $code['description'] . '<br/>';
            }
        }
    }
}