| @@ -1,215 +1,160 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* |
| 3 | -Plugin Name: Team Showcase by PickPlugins | |
| 4 | -Plugin URI: https://pickplugins.com/team/ | |
| 3 | +Plugin Name: Team | |
| 4 | +Plugin URI: http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/ | |
| 5 | 5 | Description: Fully responsive and mobile ready meet the team showcase plugin for wordpress. |
| 6 | -Version: 1.22.28 | |
| 7 | -Author: PickPlugins | |
| 8 | -Author URI: http://pickplugins.com | |
| 9 | -Text Domain: team | |
| 6 | +Version: 1.3 | |
| 7 | +Author: paratheme | |
| 8 | +Author URI: http://paratheme.com | |
| 10 | 9 | License: GPLv2 or later |
| 11 | 10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 12 | - | |
| 13 | - | |
| 14 | 11 | */ |
| 15 | 12 | |
| 16 | -if (!defined('ABSPATH')) exit; // if direct access | |
| 13 | +if ( ! defined('ABSPATH')) exit; // if direct access | |
| 17 | 14 | |
| 18 | -if (!class_exists('team')) { | |
| 19 | - class Team | |
| 20 | - { | |
| 15 | +define('team_plugin_url', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' ); | |
| 16 | +define('team_plugin_dir', plugin_dir_path( __FILE__ ) ); | |
| 17 | +define('team_wp_url', 'http://wordpress.org/plugins/team/' ); | |
| 18 | +define('team_pro_url', 'http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/' ); | |
| 19 | +define('team_demo_url', 'http://paratheme.com/items/team-responsive-meet-the-team-grid-for-wordpress/' ); | |
| 20 | +define('team_conatct_url', 'http://paratheme.com/contact' ); | |
| 21 | +define('team_qa_url', 'http://paratheme.com/qa/' ); | |
| 22 | +define('team_plugin_name', 'Team' ); | |
| 23 | +define('team_share_url', 'https://wordpress.org/plugins/team/' ); | |
| 24 | +define('team_tutorial_video_url', '//www.youtube.com/embed/8OiNCDavSQg?rel=0' ); | |
| 21 | 25 | |
| 22 | - public function __construct() | |
| 23 | - { | |
| 26 | +require_once( plugin_dir_path( __FILE__ ) . 'includes/team-meta.php'); | |
| 27 | +require_once( plugin_dir_path( __FILE__ ) . 'includes/team-functions.php'); | |
| 24 | 28 | |
| 25 | - define('team_plugin_url', plugins_url('/', __FILE__)); | |
| 26 | - define('team_plugin_dir', plugin_dir_path(__FILE__)); | |
| 27 | - define('team_plugin_name', 'Team'); | |
| 28 | - define('team_plugin_version', '1.22.28'); | |
| 29 | 29 | |
| 30 | 30 | |
| 31 | - include('includes/class-post-meta-team.php'); | |
| 32 | - include('includes/class-post-meta-team-hook.php'); | |
| 31 | +//Themes php files | |
| 32 | +require_once( plugin_dir_path( __FILE__ ) . 'themes/flat/index.php'); | |
| 33 | +require_once( plugin_dir_path( __FILE__ ) . 'themes/flat-bg/index.php'); | |
| 34 | +require_once( plugin_dir_path( __FILE__ ) . 'themes/rounded/index.php'); | |
| 33 | 35 | |
| 34 | - include('includes/class-post-types.php'); | |
| 35 | - include('includes/class-settings.php'); | |
| 36 | - include('includes/class-functions.php'); | |
| 37 | - include('includes/class-shortcodes.php'); | |
| 38 | 36 | |
| 39 | - include('includes/class-settings-tabs.php'); | |
| 40 | - include('includes/functions-settings-hook.php'); | |
| 41 | - include('includes/functions-layout-hook.php'); | |
| 42 | 37 | |
| 43 | - include('includes/class-post-meta-team-layout.php'); | |
| 44 | - include('includes/class-post-meta-team-layout-hook.php'); | |
| 45 | - include('includes/class-post-meta-team-member.php'); | |
| 46 | - include('includes/class-post-meta-team-member-hook.php'); | |
| 47 | - include('includes/class-admin-notices.php'); | |
| 48 | - include('includes/class-settings-tabs-reviews.php'); | |
| 38 | +function team_init_scripts() | |
| 39 | + { | |
| 40 | + wp_enqueue_script('jquery'); | |
| 41 | + wp_enqueue_script('team_js', plugins_url( '/js/team-scripts.js' , __FILE__ ) , array( 'jquery' )); | |
| 42 | + wp_localize_script('team_js', 'team_ajax', array( 'team_ajaxurl' => admin_url( 'admin-ajax.php'))); | |
| 43 | + wp_enqueue_style('team_style', team_plugin_url.'css/style.css'); | |
| 49 | 44 | |
| 45 | + //ParaAdmin | |
| 46 | + wp_enqueue_style('ParaAdmin', team_plugin_url.'ParaAdmin/css/ParaAdmin.css'); | |
| 47 | + wp_enqueue_style('ParaIcons', team_plugin_url.'ParaAdmin/css/ParaIcons.css'); | |
| 48 | + wp_enqueue_script('ParaAdmin', plugins_url( 'ParaAdmin/js/ParaAdmin.js' , __FILE__ ) , array( 'jquery' )); | |
| 50 | 49 | |
| 51 | - include_once team_plugin_dir . '/templates/team-showcase/team-showcase-hook.php'; | |
| 52 | - include_once team_plugin_dir . '/templates/single-team-member/team-member-hook.php'; | |
| 53 | 50 | |
| 54 | - include('includes/functions-layout-element.php'); | |
| 55 | 51 | |
| 56 | - include('includes/functions.php'); | |
| 52 | + wp_enqueue_style( 'wp-color-picker' ); | |
| 53 | + wp_enqueue_script( 'team_color_picker', plugins_url('/js/color-picker.js', __FILE__ ), array( 'wp-color-picker' ), false, true ); | |
| 54 | + | |
| 55 | + wp_enqueue_script('jquery.dotdotdot', plugins_url( '/js/jquery.dotdotdot.js' , __FILE__ ) , array( 'jquery' )); | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + // Style for themes | |
| 62 | + wp_enqueue_style('team-style-flat', team_plugin_url.'themes/flat/style.css'); | |
| 63 | + wp_enqueue_style('team-style-flat-bg', team_plugin_url.'themes/flat-bg/style.css'); | |
| 64 | + wp_enqueue_style('team-style-rounded', team_plugin_url.'themes/rounded/style.css'); | |
| 65 | + | |
| 66 | + } | |
| 67 | +add_action("init","team_init_scripts"); | |
| 57 | 68 | |
| 58 | - add_action('wp_enqueue_scripts', array($this, '_front_scripts')); | |
| 59 | - add_action('admin_enqueue_scripts', array($this, '_admin_scripts')); | |
| 60 | - add_action('plugins_loaded', array($this, '_textdomain')); | |
| 61 | - add_filter('widget_text', 'do_shortcode'); | |
| 62 | - register_activation_hook(__FILE__, array($this, '_activation')); | |
| 63 | - register_deactivation_hook(__FILE__, array($this, '_deactivation')); | |
| 64 | - add_filter('cron_schedules', array($this, 'cron_recurrence_interval')); | |
| 65 | 69 | |
| 66 | 70 | |
| 67 | 71 | |
| 68 | - // $args = array( | |
| 69 | - // 'title' => 'Hope you enjoy <b>Team Showcase</b> plugin ', | |
| 70 | - // 'option' => 'team_plugin_info', | |
| 71 | - // 'review_link' => 'https://wordpress.org/support/plugin/team/reviews/#new-post', | |
| 72 | - // 'support_link' => 'https://www.pickplugins.com/forum/', | |
| 73 | - // 'documentation_link' => 'https://www.pickplugins.com/documentation/team/', | |
| 74 | - // 'tutorials_link' => 'https://www.youtube.com/watch?v=SOe0D-Og3nQ&list=PL0QP7T2SN94atYZswlnBMhDuIYoqlmlxy', | |
| 75 | - // ); | |
| 76 | - // | |
| 77 | - // new settings_tabs_reviews($args); | |
| 78 | 72 | |
| 79 | 73 | |
| 80 | - } | |
| 81 | 74 | |
| 75 | +register_activation_hook(__FILE__, 'team_activation'); | |
| 82 | 76 | |
| 83 | - public function _textdomain() | |
| 84 | - { | |
| 85 | 77 | |
| 86 | - $locale = apply_filters('plugin_locale', get_locale(), 'team'); | |
| 87 | - load_textdomain('team', WP_LANG_DIR . '/team/team-' . $locale . '.mo'); | |
| 78 | +function team_activation() | |
| 79 | + { | |
| 80 | + $team_version= "1.3"; | |
| 81 | + update_option('team_version', $team_version); //update plugin version. | |
| 82 | + | |
| 83 | + $team_customer_type= "free"; //customer_type "free" | |
| 84 | + update_option('team_customer_type', $team_customer_type); //update plugin version. | |
| 85 | + | |
| 86 | + | |
| 88 | 87 | |
| 89 | - load_plugin_textdomain('team', false, plugin_basename(dirname(__FILE__)) . '/languages/'); | |
| 90 | - } | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + } | |
| 91 | 93 | |
| 92 | 94 | |
| 93 | - public function _activation() | |
| 94 | - { | |
| 95 | +function team_display($atts, $content = null ) { | |
| 96 | + $atts = shortcode_atts( | |
| 97 | + array( | |
| 98 | + 'id' => "", | |
| 95 | 99 | |
| 96 | - // Reset permalink | |
| 97 | - $team_class_post_types = new team_class_post_types(); | |
| 98 | - $team_class_post_types->_posttype_team_member(); | |
| 99 | - $team_class_post_types->_posttype_team(); | |
| 100 | + ), $atts); | |
| 100 | 101 | |
| 101 | - flush_rewrite_rules(); | |
| 102 | 102 | |
| 103 | - $xml_source = team_plugin_url . '/sample-data/team-layouts.json'; | |
| 104 | - team_import_xml_layouts($xml_source); | |
| 103 | + $post_id = $atts['id']; | |
| 105 | 104 | |
| 106 | - do_action('team_activation'); | |
| 107 | - } | |
| 105 | + $team_themes = get_post_meta( $post_id, 'team_themes', true ); | |
| 108 | 106 | |
| 107 | + $team_display =""; | |
| 109 | 108 | |
| 110 | - public function team_uninstall() | |
| 111 | - { | |
| 109 | + if($team_themes== "flat") | |
| 110 | + { | |
| 111 | + $team_display.= team_body_flat($post_id); | |
| 112 | + } | |
| 112 | 113 | |
| 113 | - do_action('team_uninstall'); | |
| 114 | - } | |
| 114 | + elseif($team_themes== "flat-bg") | |
| 115 | + { | |
| 116 | + $team_display.= team_body_flat_bg($post_id); | |
| 117 | + } | |
| 118 | + elseif($team_themes== "rounded") | |
| 119 | + { | |
| 120 | + $team_display.= team_body_rounded($post_id); | |
| 121 | + } | |
| 122 | + | |
| 123 | + | |
| 115 | 124 | |
| 116 | - public function _deactivation() | |
| 117 | - { | |
| 125 | +return $team_display; | |
| 118 | 126 | |
| 119 | - wp_clear_scheduled_hook('team_cron_upgrade_settings'); | |
| 120 | - wp_clear_scheduled_hook('team_cron_upgrade_team_members'); | |
| 121 | - wp_clear_scheduled_hook('team_cron_upgrade_team'); | |
| 122 | 127 | |
| 123 | - do_action('team_deactivation'); | |
| 124 | - } | |
| 125 | 128 | |
| 129 | +} | |
| 126 | 130 | |
| 127 | - function cron_recurrence_interval($schedules) | |
| 128 | - { | |
| 131 | +add_shortcode('team', 'team_display'); | |
| 129 | 132 | |
| 130 | - $schedules['1minute'] = array( | |
| 131 | - 'interval' => 40, | |
| 132 | - 'display' => __('1 Minute', 'team') | |
| 133 | - ); | |
| 134 | 133 | |
| 135 | 134 | |
| 136 | 135 | |
| 137 | - return $schedules; | |
| 138 | - } | |
| 139 | 136 | |
| 137 | +add_action('admin_menu', 'team_menu_init'); | |
| 140 | 138 | |
| 141 | - public function _front_scripts() | |
| 142 | - { | |
| 143 | 139 | |
| 144 | - wp_enqueue_script('jquery'); | |
| 140 | + | |
| 141 | +function team_menu_help(){ | |
| 142 | + include('team-help.php'); | |
| 143 | +} | |
| 145 | 144 | |
| 146 | - wp_register_script('masonry', plugins_url('/assets/front/js/masonry.js', __FILE__), array('jquery')); | |
| 147 | - wp_register_script('imagesloaded', plugins_url('/assets/front/js/imagesloaded.js', __FILE__), array('jquery')); | |
| 148 | - wp_register_style('font-awesome-5', team_plugin_url . 'assets/admin/css/fontawesome.css'); | |
| 145 | +function team_menu_settings(){ | |
| 146 | + include('team-settings.php'); | |
| 147 | +} | |
| 149 | 148 | |
| 150 | - do_action('team_front_scripts'); | |
| 151 | - } | |
| 149 | +function team_menu_init() | |
| 150 | + { | |
| 151 | + add_submenu_page('edit.php?post_type=team', __('Settings','menu-team'), __('Settings','menu-team'), 'manage_options', 'team_menu_settings', 'team_menu_settings'); | |
| 152 | 152 | |
| 153 | - public function _admin_scripts() | |
| 154 | - { | |
| 155 | - $screen = get_current_screen(); | |
| 156 | 153 | |
| 157 | - wp_enqueue_script('jquery'); | |
| 158 | - wp_enqueue_script('jquery-ui-core'); | |
| 159 | - wp_enqueue_script('jquery-ui-sortable'); | |
| 154 | + } | |
| 160 | 155 | |
| 161 | - wp_enqueue_script('team_scripts', team_plugin_url . 'assets/admin/js/scripts.js', array('jquery')); | |
| 162 | - //wp_localize_script('team_scripts', 'team_ajax', array('team_ajaxurl' => admin_url('admin-ajax.php'))); | |
| 163 | 156 | |
| 164 | - wp_localize_script( | |
| 165 | - 'team_scripts', | |
| 166 | - 'team_ajax', | |
| 167 | - array( | |
| 168 | - 'team_ajaxurl' => admin_url('admin-ajax.php'), | |
| 169 | - 'ajax_nonce' => wp_create_nonce('team_ajax_nonce'), | |
| 170 | - ) | |
| 171 | - ); | |
| 172 | 157 | |
| 173 | 158 | |
| 174 | 159 | |
| 175 | - //wp_enqueue_script('wp-color-picker'); | |
| 176 | - //wp_enqueue_style('wp-color-picker'); | |
| 177 | - | |
| 178 | - wp_register_script('settings-tabs', team_plugin_url . 'assets/settings-tabs/settings-tabs.js', array('jquery')); | |
| 179 | - wp_register_style('settings-tabs', team_plugin_url . 'assets/settings-tabs/settings-tabs.css'); | |
| 180 | - wp_register_style('font-awesome-5', team_plugin_url . 'assets/admin/css/fontawesome.css'); | |
| 181 | - | |
| 182 | - wp_register_script('jquery.lazy', team_plugin_url . 'assets/admin/js/jquery.lazy.js', array('jquery')); | |
| 183 | - wp_enqueue_script('jquery.lazy'); | |
| 184 | - | |
| 185 | - //wp_enqueue_script( 'team_scripts' ); | |
| 186 | - | |
| 187 | - | |
| 188 | - //$cm_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/css')); | |
| 189 | - | |
| 190 | - //wp_localize_script('jquery', 'cm_settings', $cm_settings); | |
| 191 | - | |
| 192 | - //wp_enqueue_script('wp-theme-plugin-editor'); | |
| 193 | - //wp_enqueue_style('wp-codemirror'); | |
| 194 | - | |
| 195 | - | |
| 196 | - if ($screen->id == 'team_member' || $screen->id == 'team' || $screen->id == 'team_layout') { | |
| 197 | - | |
| 198 | - | |
| 199 | - $settings_tabs_field = new settings_tabs_field(); | |
| 200 | - $settings_tabs_field->admin_scripts(); | |
| 201 | - } | |
| 202 | - | |
| 203 | - | |
| 204 | - | |
| 205 | - | |
| 206 | - | |
| 207 | - | |
| 208 | - | |
| 209 | - do_action('team_admin_scripts'); | |
| 210 | - } | |
| 211 | - } | |
| 212 | -} | |
| 213 | - | |
| 214 | - | |
| 215 | -new Team(); | |
| 160 | +?> | |