Created
July 6, 2017 10:43
-
-
Save maugelves/29f9aeee8d18d722dad8a1129f1b11d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 1. Declaro el include a la librería TGM Plugin Activation | |
include_once __DIR__ . "/inc/lib/class-tgm-plugin-activation.php"; | |
/** | |
* 2. En la acción 'tgmpa_register' declaro las dependencias del plugin | |
* siguiendo las pautas de la documentación oficial: | |
* http://tgmpluginactivation.com/configuration/ | |
*/ | |
function crear_depedendencia_de_plugin() { | |
// Array con dependencias de plugins | |
$plugins = array( | |
array( | |
'name' => 'Advanced Custom Fields PRO', // El nombre del plugin. | |
'slug' => 'advanced-custom-fields-pro', // El slug del plugin (normalmente el nombre de la carpeta). | |
'required' => true, // Si lo definimos como false el plugin será "recomendado" en lugar de obligatorio. | |
'external_url' => 'https://www.advancedcustomfields.com/pro/', // En caso de no estar instalado generará un enlace para descargarlo. | |
), | |
); | |
tgmpa( $plugins ); | |
} | |
add_action( 'tgmpa_register', 'crear_depedendencia_de_plugin' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment