| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Team Showcase by PickPlugins |
| 4 |
Plugin URI: http://www.pickplugins.com/item/team-responsive-meet-the-team-grid-for-wordpress/?ref=dashboard |
| 5 |
Description: Fully responsive and mobile ready meet the team showcase plugin for wordpress. |
| 6 |
Version: 1.22.0 |
| 7 |
Author: PickPlugins |
| 8 |
Author URI: http://pickplugins.com |
| 9 |
Text Domain: team |
| 10 |
License: GPLv2 or later |
| 11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 12 |
|
| 13 |
|
| 14 |
*/ |
| 15 |
|
| 16 |
if ( ! defined('ABSPATH')) exit; // if direct access |
| 17 |
|
| 18 |
if( ! class_exists( 'Team' ) ) { |
| 19 |
class Team{ |
| 20 |
|
| 21 |
public function __construct(){ |
| 22 |
|
| 23 |
define('team_plugin_url', plugins_url('/', __FILE__)); |
| 24 |
define('team_plugin_dir', plugin_dir_path(__FILE__)); |
| 25 |
define('team_plugin_name', 'Team'); |
| 26 |
define('team_plugin_version', '1.22.0'); |
| 27 |
|
| 28 |
include('includes/functions-data-upgrade.php'); |
| 29 |
|
| 30 |
include('includes/class-post-meta-team.php'); |
| 31 |
include('includes/class-post-meta-team-hook.php'); |
| 32 |
|
| 33 |
include('includes/class-post-types.php'); |
| 34 |
include('includes/class-settings.php'); |
| 35 |
include('includes/class-functions.php'); |
| 36 |
include('includes/class-shortcodes.php'); |
| 37 |
|
| 38 |
include('includes/class-settings-tabs.php'); |
| 39 |
include('includes/functions-settings-hook.php'); |
| 40 |
include('includes/functions-layout-hook.php'); |
| 41 |
|
| 42 |
include('includes/class-post-meta-team-layout.php'); |
| 43 |
include('includes/class-post-meta-team-layout-hook.php'); |
| 44 |
include('includes/class-post-meta-team-member.php'); |
| 45 |
include('includes/class-post-meta-team-member-hook.php'); |
| 46 |
include('includes/class-admin-notices.php'); |
| 47 |
|
| 48 |
|
| 49 |
include_once team_plugin_dir . '/templates/team-showcase/team-showcase-hook.php'; |
| 50 |
include_once team_plugin_dir . '/templates/single-team-member/team-member-hook.php'; |
| 51 |
|
| 52 |
include('includes/functions-layout-element.php'); |
| 53 |
|
| 54 |
include('includes/functions.php'); |
| 55 |
|
| 56 |
add_action('wp_enqueue_scripts', array($this, '_front_scripts')); |
| 57 |
add_action('admin_enqueue_scripts', array($this, '_admin_scripts')); |
| 58 |
add_action('plugins_loaded', array($this, '_textdomain')); |
| 59 |
add_filter('widget_text', 'do_shortcode'); |
| 60 |
register_activation_hook(__FILE__, array($this, '_activation')); |
| 61 |
register_deactivation_hook(__FILE__, array($this, '_deactivation')); |
| 62 |
add_filter('cron_schedules', array($this, 'cron_recurrence_interval')); |
| 63 |
|
| 64 |
|
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
public function _textdomain(){ |
| 69 |
|
| 70 |
$locale = apply_filters('plugin_locale', get_locale(), 'team'); |
| 71 |
load_textdomain('team', WP_LANG_DIR . '/team/team-' . $locale . '.mo'); |
| 72 |
|
| 73 |
load_plugin_textdomain('team', false, plugin_basename(dirname(__FILE__)) . '/languages/'); |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
public function _activation(){ |
| 78 |
|
| 79 |
// Reset permalink |
| 80 |
$team_class_post_types = new team_class_post_types(); |
| 81 |
$team_class_post_types->_posttype_team_member(); |
| 82 |
flush_rewrite_rules(); |
| 83 |
|
| 84 |
|
| 85 |
do_action('team_activation'); |
| 86 |
|
| 87 |
} |
| 88 |
|
| 89 |
|
| 90 |
public function team_uninstall(){ |
| 91 |
|
| 92 |
do_action('team_uninstall'); |
| 93 |
} |
| 94 |
|
| 95 |
public function _deactivation(){ |
| 96 |
|
| 97 |
wp_clear_scheduled_hook('team_cron_upgrade_settings'); |
| 98 |
wp_clear_scheduled_hook('team_cron_upgrade_team_members'); |
| 99 |
wp_clear_scheduled_hook('team_cron_upgrade_team'); |
| 100 |
|
| 101 |
do_action('team_deactivation'); |
| 102 |
} |
| 103 |
|
| 104 |
|
| 105 |
function cron_recurrence_interval($schedules){ |
| 106 |
|
| 107 |
$schedules['2minute'] = array( |
| 108 |
'interval' => 120, |
| 109 |
'display' => __('2 Minute', 'team') |
| 110 |
); |
| 111 |
|
| 112 |
$schedules['5minute'] = array( |
| 113 |
'interval' => 300, |
| 114 |
'display' => __('5 Minute', 'team') |
| 115 |
); |
| 116 |
|
| 117 |
|
| 118 |
return $schedules; |
| 119 |
} |
| 120 |
|
| 121 |
|
| 122 |
public function _front_scripts(){ |
| 123 |
|
| 124 |
wp_enqueue_script('jquery'); |
| 125 |
|
| 126 |
wp_register_style('single-team-member', plugins_url('assets/front/css/single-team-member.css', __FILE__)); |
| 127 |
wp_register_script('masonry', plugins_url('/assets/front/js/masonry.js', __FILE__), array('jquery')); |
| 128 |
wp_register_script('imagesloaded', plugins_url('/assets/front/js/imagesloaded.js', __FILE__), array('jquery')); |
| 129 |
wp_register_style('font-awesome-5', team_plugin_url . 'assets/admin/css/fontawesome.css'); |
| 130 |
|
| 131 |
do_action('team_front_scripts'); |
| 132 |
} |
| 133 |
|
| 134 |
public function _admin_scripts(){ |
| 135 |
|
| 136 |
wp_enqueue_script('jquery'); |
| 137 |
wp_enqueue_script('jquery-ui-core'); |
| 138 |
wp_enqueue_script('jquery-ui-sortable'); |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
wp_enqueue_script('wp-color-picker'); |
| 143 |
wp_enqueue_style('wp-color-picker'); |
| 144 |
|
| 145 |
wp_register_script('settings-tabs', team_plugin_url . 'assets/admin/js/settings-tabs.js', array('jquery')); |
| 146 |
wp_register_style('settings-tabs', team_plugin_url . 'assets/admin/css/settings-tabs.css'); |
| 147 |
wp_register_style('font-awesome-5', team_plugin_url . 'assets/admin/css/fontawesome.css'); |
| 148 |
|
| 149 |
$cm_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/css')); |
| 150 |
|
| 151 |
wp_localize_script('jquery', 'cm_settings', $cm_settings); |
| 152 |
|
| 153 |
wp_enqueue_script('wp-theme-plugin-editor'); |
| 154 |
//wp_enqueue_style('wp-codemirror'); |
| 155 |
|
| 156 |
do_action('team_admin_scripts'); |
| 157 |
} |
| 158 |
|
| 159 |
} |
| 160 |
} |
| 161 |
|
| 162 |
|
| 163 |
new Team(); |
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|