PluginsLoadedActions.php in Maps Plugin using Google Maps for WordPress – WP Google Map trunk, at includes/traits/PluginsLoadedActions.php
| 1 | <?php |
| 2 | |
| 3 | namespace WGMSRM\Traits; |
| 4 | |
| 5 | use WGMSRM\Classes\Database; |
| 6 | |
| 7 | if (!defined('ABSPATH')) { |
| 8 | exit; |
| 9 | } |
| 10 | |
| 11 | /** |
| 12 | * Trait PluginsLoadedActions |
| 13 | */ |
| 14 | trait PluginsLoadedActions |
| 15 | { |
| 16 | |
| 17 | /** |
| 18 | * Fires after plugins loaded |
| 19 | */ |
| 20 | public function wpgmap_do_after_plugins_loaded() |
| 21 | { |
| 22 | // Defensive: Only allow if user has install_plugins capability (for DB changes) |
| 23 | if (current_user_can('install_plugins')) { |
| 24 | new Database(); |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 |