class-classes-helper.php
3 years ago
class-file-writer.php
3 years ago
class-php-helper.php
3 years ago
class-user-helper.php
3 years ago
class-wp-helper.php
3 years ago
class-php-helper.php
47 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Responsible for the User's operations |
| 4 | * |
| 5 | * @package wp2fa |
| 6 | * @subpackage helpers |
| 7 | * @since latest |
| 8 | * @copyright 2023 WP White Security |
| 9 | * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 |
| 10 | * @link https://wordpress.org/plugins/wp-2fa/ |
| 11 | */ |
| 12 | |
| 13 | namespace WP2FA\Admin\Helpers; |
| 14 | |
| 15 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 16 | |
| 17 | /** |
| 18 | * User's settings class |
| 19 | */ |
| 20 | if ( ! class_exists( '\WP2FA\Admin\Helpers\PHP_Helper' ) ) { |
| 21 | |
| 22 | /** |
| 23 | * All the user related settings must go trough this class. |
| 24 | * |
| 25 | * @since 2.4.0 |
| 26 | */ |
| 27 | class PHP_Helper { |
| 28 | |
| 29 | /** |
| 30 | * Checks if given function is callable (exists) or not |
| 31 | * |
| 32 | * @param string $function - The name of the function to check. |
| 33 | * |
| 34 | * @return boolean |
| 35 | * |
| 36 | * @since 2.4.0 |
| 37 | */ |
| 38 | public static function is_callable( string $function ): bool { |
| 39 | if ( ! is_callable( $function ) ) { |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 |