Support

Account

Home Forums ACF PRO Including ACF Pro in a Plugin Reply To: Including ACF Pro in a Plugin

  • You need to write the logic into your plugin to find out if the plugin is already activated.

    This should get you started:

    /* Checks to see if "is_plugin_active" function exists and if not load the php file that includes that function */
    if ( ! function_exists( 'is_plugin_active' ) ) {
    	include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
    }
    
    /* Checks to see if the acf pro plugin is activated  */
    if ( !is_plugin_active('advanced-custom-fields-pro/acf.php') )  {
     /* load the plugin and anything else you want to do */
    }
    
    /* Checks to see if the acf plugin is activated  */
    if ( !is_plugin_active('advanced-custom-fields/acf.php') )  {
     /* load the plugin and anything else you want to do */
    }