This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathacf-widgets.php
executable file
·85 lines (64 loc) · 2.28 KB
/
acf-widgets.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* Plugin Name: ACF Widgets
* Plugin URI: https://acfwidgets.com
* Description: A plugin to easily create widgets for use with ACF and add custom fields to any widget on your site.
* Version: 1.12.2
* Tested up to: 5.0.3
* Author: Daron Spence
* Author URI: http://acfwidgets.com
* Text Domain: acfw
* License: GPL2+
*/
// Block direct requests
if ( !defined('ABSPATH') ){
die();
}
define( 'ACFW_VERSION', '1.12.2' );
define( 'ACFW_STORE_URL', 'https://acfwidgets.com' );
define( 'ACFW_ITEM_NAME', 'ACF Widgets' );
define( 'ACFW_FILE' , __FILE__ );
add_action('after_setup_theme', 'acfw_globals');
function acfw_globals(){
if ( apply_filters( 'acfw_lite', false ) )
define( 'ACFW_LITE', true );
if ( apply_filters( 'acfw_include', false ) )
define('ACFW_INCLUDE', true);
}
// Check to see if ACF is active
include_once('includes/acf-404.php');
$GLOBALS['acfw_default_widgets'] = array('pages', 'calendar', 'archives', 'meta', 'search', 'text',
'categories', 'recent-posts', 'recent-comments', 'rss', 'tag_cloud', 'nav_menu');
include_once('includes/helper-functions.php');
include_once('includes/admin-setup.php');
require_once('includes/ACFW_Widget.php');
require_once('includes/ACFW_Widget_Factory.php');
include_once('includes/widgets-setup.php');
include_once('includes/default-widgets.php');
if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
// load our custom updater
include( dirname( __FILE__ ) . '/EDD_SL_Plugin_Updater.php' );
}
function acfw_plugin_updater() {
$license_key = trim( get_option( 'acfw_license_key' ) );
// setup the updater
$edd_updater = new EDD_SL_Plugin_Updater( ACFW_STORE_URL, __FILE__, array(
'version' => ACFW_VERSION, // current version number
'license' => $license_key, // license key (used get_option above to retrieve from DB)
'item_name' => ACFW_ITEM_NAME, // name of this plugin
'author' => 'Daron Spence', // author of this plugin
'url' => home_url()
)
);
}
if(!defined('ACFW_INCLUDE') && get_option('acfw_license_key') != ''){
add_action( 'admin_init', 'acfw_plugin_updater', 0 );
}
register_activation_hook( __FILE__, 'acfw_activate' );
function acfw_activate(){
$users = get_users('meta_key=acfw_dismiss_expired');
foreach ($users as $user) {
delete_user_meta( $user->id, 'acfw_dismiss_expired' );
}
}
// End of File