secure-custom-fields
Last commit date
assets
6 months ago
includes
6 months ago
lang
7 months ago
pro
6 months ago
schemas
6 months ago
vendor
6 months ago
SECURITY.md
1 year ago
acf.php
7 months ago
composer.json
7 months ago
index.php
1 year ago
license.txt
1 year ago
readme.txt
6 months ago
secure-custom-fields.php
6 months ago
acf.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This file is for the converting of sites from acf.php to secure-custom-fields.php as the main plugin file. |
| 4 | * |
| 5 | * Under this slug, acf.php would have been the main plugin file in < 6.4.0-beta4. |
| 6 | * |
| 7 | * @package wordpress/secure-custom-fields |
| 8 | */ |
| 9 | |
| 10 | // Exit if accessed directly. |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit; |
| 13 | } |
| 14 | |
| 15 | if ( is_admin() ) { |
| 16 | include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 17 | |
| 18 | // Network activations first since is_plugin_active will return true for network activated plugins, whereas this won't for single. |
| 19 | if ( is_plugin_active_for_network( 'secure-custom-fields/acf.php' ) ) { |
| 20 | if ( ! activate_plugin( 'secure-custom-fields/secure-custom-fields.php', '', true, true ) ) { |
| 21 | // activate_plugin returns null on success or WP_Error on failure. |
| 22 | deactivate_plugins( 'secure-custom-fields/acf.php', false, true ); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Single site activations. |
| 27 | if ( is_plugin_active( 'secure-custom-fields/acf.php' ) ) { |
| 28 | if ( ! activate_plugin( 'secure-custom-fields/secure-custom-fields.php', '', false, true ) ) { |
| 29 | // activate_plugin returns null on success or WP_Error on failure. |
| 30 | deactivate_plugins( 'secure-custom-fields/acf.php', false, false ); |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // Include the main plugin file to ensure it's loaded if the switch hasn't occurred. |
| 36 | require_once __DIR__ . '/secure-custom-fields.php'; |
| 37 |