PluginProbe
Advanced Ads – Ad Manager & AdSense / 1.3.13
Advanced Ads – Ad Manager & AdSense v1.3.13
2.0.26 2.0.25 2.0.24 2.0.23 2.0.22 2.0.21 1.38.0 1.39.0 1.39.1 1.39.2 1.39.3 1.39.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.40.0 1.40.1 1.40.2 All 348 releases
advanced-ads / advanced-ads.php
advanced-ads.php
88 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Advanced Ads.
4 *
5 * @package Advanced_Ads_Admin
6 * @author Thomas Maier <thomas.maier@webgilde.com>
7 * @license GPL-2.0+
8 * @link http://webgilde.com
9 * @copyright 2013-2014 Thomas Maier, webgilde GmbH
10 *
11 * @wordpress-plugin
12 * Plugin Name: Advanced Ads
13 * Plugin URI: http://wpadvancedads.com
14 * Description: Manage and optimize your ads in WordPress
15 * Version: 1.3.13
16 * Author: Thomas Maier
17 * Author URI: http://webgilde.com
18 * Text Domain: advanced-ads
19 * License: GPL-2.0+
20 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
21 * Domain Path: /languages
22 */
23
24 // If this file is called directly, abort.
25 if ( ! defined( 'WPINC' ) ) {
26 die;
27 }
28
29 // only load if not already existing (maybe included from another plugin)
30 if( defined('ADVADS_BASE_PATH') ) {
31 return ;
32 }
33
34 // load basic path to the plugin
35 define('ADVADS_BASE_PATH', plugin_dir_path(__FILE__));
36 define('ADVADS_BASE_URL', plugin_dir_url(__FILE__));
37 // general and global slug, e.g. to store options in WP, textdomain
38 define('ADVADS_SLUG', 'advanced-ads');
39
40 /*----------------------------------------------------------------------------*
41 * Autoloading Objects
42 *----------------------------------------------------------------------------*/
43 if (!class_exists('Advanced_Ads', true)) {
44 require_once( plugin_dir_path( __FILE__ ) . 'includes/autoloader.php' );
45 require_once( plugin_dir_path( __FILE__ ) . 'public/class-advanced-ads.php' );
46 spl_autoload_register(array('Advads_Autoloader', 'load'));
47 }
48
49 /*----------------------------------------------------------------------------*
50 * Public-Facing Functionality
51 *----------------------------------------------------------------------------*/
52
53 /*
54 * Register hooks that are fired when the plugin is activated or deactivated.
55 * When the plugin is deleted, the uninstall.php file is loaded.
56 *
57 */
58 register_activation_hook( __FILE__, array( 'Advanced_Ads', 'activate' ) );
59 register_deactivation_hook( __FILE__, array( 'Advanced_Ads', 'deactivate' ) );
60
61 add_action( 'plugins_loaded', array( 'Advanced_Ads', 'get_instance' ) );
62
63 /*----------------------------------------------------------------------------*
64 * Dashboard and Administrative Functionality
65 *----------------------------------------------------------------------------*/
66
67 if( defined('DOING_AJAX') ) {
68 new Advads_Ad_Ajax_Callbacks;
69 }
70 // load ad conditions array
71 require_once( plugin_dir_path( __FILE__ ) . 'includes/array_ad_conditions.php' );
72
73 if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
74 require_once( plugin_dir_path( __FILE__ ) . 'admin/class-advanced-ads-admin.php' );
75 add_action( 'plugins_loaded', array( 'Advanced_Ads_Admin', 'get_instance' ) );
76 }
77
78 // load public functions
79 require_once( plugin_dir_path( __FILE__ ) . 'public/functions.php' );
80
81 // load widget
82 require_once( plugin_dir_path( __FILE__ ) . 'classes/widget.php' );
83 function advads_widget_init() {
84 register_widget('Advads_Widget');
85 }
86
87 add_action('widgets_init', 'advads_widget_init');
88