-
Notifications
You must be signed in to change notification settings - Fork 1
/
cfc-redirect.php
40 lines (33 loc) · 1.18 KB
/
cfc-redirect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Plugin Name: Caldera Forms CiviCRM Redirect
* Description: Redirect CiviCRM Contribution and Event pages to Caldera Forms.
* Version: 0.4
* Author: Andrei Mondoc
* Author URI: https://github.com/mecachisenros
* Plugin URI: https://github.com/mecachisenros/cfc-redirect
* GitHub Plugin URI: mecachisenros/cfc-redirect
*/
// bail if called directly
if ( ! defined( 'WPINC' ) ) die( 'Cheating huh!?' );
// version
define( 'CFC_REDIRECT_VERSION', '0.4' );
// plugin basename
define( 'CFC_REDIRECT_BASE', plugin_basename( __FILE__ ) );
// plugin path
define( 'CFC_REDIRECT_PATH', plugin_dir_path( __FILE__ ) );
// source path
define( 'CFC_REDIRECT_SRC', CFC_REDIRECT_PATH . 'src' );
// plugin url
define( 'CFC_REDIRECT_URL', plugin_dir_url( __FILE__ ) );
add_action( 'plugins_loaded', function() {
// bail if Caldera Forms is not available
if ( ! defined( 'CFCORE_VER' ) ) return;
// bail if CiviCRM is not available
if ( ! function_exists( 'civi_wp' ) ) return;
// autoloader
require_once( trailingslashit( CFC_REDIRECT_SRC ) . 'Autoloader.php' );
new CFCR\Autoloader( $namespace = 'CFCR', $source_path = CFC_REDIRECT_SRC );
// initialize plugin
new CFCR\Plugin( __FILE__ );
} );