Falcon::get_handlers PHP Метод

get_handlers() публичный статический Метод

Get all available handlers
public static get_handlers ( ) : array
Результат array Associative array of identifier => handler class
    public static function get_handlers()
    {
        $default = array('postmark' => 'Falcon_Handler_Postmark', 'mandrill' => 'Falcon_Handler_Mandrill');
        return apply_filters('bbsub_handlers', $default);
    }

Usage Example

Пример #1
0
 /**
  * Validate the handler type
  *
  * Ensures that the selected type can actually be selected
  * @param string $input Selected class name
  * @return string|bool Selected class name if valid, otherwise false
  */
 public static function validate_type($input)
 {
     if (in_array($input, array_keys(Falcon::get_handlers()))) {
         if ($input !== Falcon::get_option('bbsub_handler_type', false) && empty($_POST['bbsub_used_ajax'])) {
             self::$wipe_handler_options = true;
         }
         return $input;
     }
     add_settings_error('bbsub_handler_type', 'bbsub_handler_invalid', __('The selected handler is invalid', 'falcon'));
     return false;
 }