Exemplo n.º 1
2
 /**
  * Constructor for the Anthologize class
  *
  * This constructor does the following:
  * - Checks minimum PHP and WP version, and bails if they're not met
  * - Includes Anthologize's main files
  * - Sets up the basic hooks that initialize Anthologize's post types and UI
  *
  * @since 0.7
  */
 public function __construct()
 {
     // Bail if PHP version is not at least 5.0
     if (!self::check_minimum_php()) {
         add_action('admin_notices', array('Anthologize', 'phpversion_nag'));
         return;
     }
     // Bail if WP version is not at least 3.3
     if (!self::check_minimum_wp()) {
         add_action('admin_notices', array('Anthologize', 'wpversion_nag'));
     }
     // If we've made it this far, start initializing Anthologize
     register_activation_hook(__FILE__, array($this, 'activation'));
     register_deactivation_hook(__FILE__, array($this, 'deactivation'));
     // @todo WP's functions plugin_basename() etc don't work
     //   correctly on symlinked setups, so I'm implementing my own
     $bn = explode(DIRECTORY_SEPARATOR, dirname(__FILE__));
     $this->basename = array_pop($bn);
     $this->plugin_dir = plugin_dir_path(__FILE__);
     $this->plugin_url = plugin_dir_url(__FILE__);
     $this->includes_dir = trailingslashit($this->plugin_dir . 'includes');
     $upload_dir = wp_upload_dir();
     $this->cache_dir = trailingslashit($upload_dir['basedir'] . '/anthologize-cache');
     $this->cache_url = trailingslashit($upload_dir['baseurl'] . '/anthologize-cache');
     $this->setup_constants();
     $this->includes();
     $this->setup_hooks();
 }
 public function __construct()
 {
     define('job_bm_plugin_url', WP_PLUGIN_URL . '/' . plugin_basename(dirname(__FILE__)) . '/');
     define('job_bm_plugin_dir', plugin_dir_path(__FILE__));
     define('job_bm_wp_url', 'https://wordpress.org/plugins/job-board-manager/');
     define('job_bm_wp_reviews', 'http://wordpress.org/support/view/plugin-reviews/job-board-manager');
     define('job_bm_pro_url', 'http://www.pickplugins.com/item/job-board-manager-create-job-site-for-wordpress/');
     define('job_bm_demo_url', 'www.pickplugins.com/demo/job-board-manager/');
     define('job_bm_conatct_url', 'http://www.pickplugins.com/contact/');
     define('job_bm_qa_url', 'http://www.pickplugins.com/questions/');
     define('job_bm_plugin_name', 'Job Board Manager');
     define('job_bm_plugin_version', '1.0.11');
     define('job_bm_customer_type', 'free');
     // pro & free
     define('job_bm_share_url', 'https://wordpress.org/plugins/job-board-manager/');
     define('job_bm_tutorial_video_url', '//www.youtube.com/embed/Z-ZzJiyVNJ4?rel=0');
     // Class
     require_once plugin_dir_path(__FILE__) . 'includes/class-post-types.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-post-meta.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-shortcodes.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-functions.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-settings.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-emails.php';
     //Front-end Forms Input Class
     require_once plugin_dir_path(__FILE__) . 'includes/class-frontend-forms-input.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-frontend-form-edit-job.php';
     require_once plugin_dir_path(__FILE__) . 'includes/class-frontend-form-new-job.php';
     require_once plugin_dir_path(__FILE__) . 'includes/ajax-upload.php';
     // Function's
     require_once plugin_dir_path(__FILE__) . 'includes/functions.php';
     add_action('admin_enqueue_scripts', 'wp_enqueue_media');
     add_action('wp_enqueue_scripts', array($this, 'job_bm_front_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'job_bm_admin_scripts'));
 }
Exemplo n.º 3
1
 function cherry_plugin_settings()
 {
     global $wpdb;
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $upload_dir = wp_upload_dir();
     $plugin_data = get_plugin_data(plugin_dir_path(__FILE__) . 'cherry-plugin.php');
     //Cherry plugin constant variables
     define('CHERRY_PLUGIN_DIR', plugin_dir_path(__FILE__));
     define('CHERRY_PLUGIN_URL', plugin_dir_url(__FILE__));
     define('CHERRY_PLUGIN_DOMAIN', $plugin_data['TextDomain']);
     define('CHERRY_PLUGIN_DOMAIN_DIR', $plugin_data['DomainPath']);
     define('CHERRY_PLUGIN_VERSION', $plugin_data['Version']);
     define('CHERRY_PLUGIN_NAME', $plugin_data['Name']);
     define('CHERRY_PLUGIN_SLUG', plugin_basename(__FILE__));
     define('CHERRY_PLUGIN_DB', $wpdb->prefix . CHERRY_PLUGIN_DOMAIN);
     define('CHERRY_PLUGIN_REMOTE_SERVER', esc_url('http://tmbhtest.com/cherryframework.com/components_update/'));
     //Other constant variables
     define('CURRENT_THEME_DIR', get_stylesheet_directory());
     define('CURRENT_THEME_URI', get_stylesheet_directory_uri());
     define('UPLOAD_BASE_DIR', str_replace("\\", "/", $upload_dir['basedir']));
     define('UPLOAD_DIR', str_replace("\\", "/", $upload_dir['path'] . '/'));
     // if ( !defined('API_URL') ) {
     // 	define( 'API_URL', esc_url( 'http://updates.cherry.template-help.com/cherrymoto/v3/api/' ) );
     // }
     load_plugin_textdomain(CHERRY_PLUGIN_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/' . CHERRY_PLUGIN_DOMAIN_DIR);
     do_action('cherry_plugin_settings');
 }
 /**
  * Init plugin after all plugins has been loaded
  */
 function init()
 {
     // Load Divi 100 Setup
     require_once plugin_dir_path(__FILE__) . 'divi-100-setup/divi-100-setup.php';
     // Load Hamburger Menu
     ET_Divi_100_Custom_Hamburger_Menu::instance();
 }
Exemplo n.º 5
0
 /**
  * Constructor - get the plugin hooked in and ready
  */
 public function __construct()
 {
     // Define constants
     define('JOB_MANAGER_VERSION', '1.23.9');
     define('JOB_MANAGER_PLUGIN_DIR', untrailingslashit(plugin_dir_path(__FILE__)));
     define('JOB_MANAGER_PLUGIN_URL', untrailingslashit(plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__))));
     // Includes
     include 'includes/class-wp-job-manager-install.php';
     include 'includes/class-wp-job-manager-post-types.php';
     include 'includes/class-wp-job-manager-ajax.php';
     include 'includes/class-wp-job-manager-shortcodes.php';
     include 'includes/class-wp-job-manager-api.php';
     include 'includes/class-wp-job-manager-forms.php';
     include 'includes/class-wp-job-manager-geocode.php';
     include 'includes/class-wp-job-manager-cache-helper.php';
     if (is_admin()) {
         include 'includes/admin/class-wp-job-manager-admin.php';
     }
     // Init classes
     $this->forms = new WP_Job_Manager_Forms();
     $this->post_types = new WP_Job_Manager_Post_Types();
     // Activation - works with symlinks
     register_activation_hook(basename(dirname(__FILE__)) . '/' . basename(__FILE__), array($this, 'activate'));
     // Switch theme
     add_action('after_switch_theme', array('WP_Job_Manager_Ajax', 'add_endpoint'), 10);
     add_action('after_switch_theme', array($this->post_types, 'register_post_types'), 11);
     add_action('after_switch_theme', 'flush_rewrite_rules', 15);
     // Actions
     add_action('after_setup_theme', array($this, 'load_plugin_textdomain'));
     add_action('after_setup_theme', array($this, 'include_template_functions'), 11);
     add_action('widgets_init', array($this, 'widgets_init'));
     add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
     add_action('admin_init', array($this, 'updater'));
 }
 function plugin_path()
 {
     if ($this->plugin_path) {
         return $this->plugin_path;
     }
     return $this->plugin_path = untrailingslashit(plugin_dir_path(__FILE__));
 }
Exemplo n.º 7
0
 /**
  * Bootstrap constants.
  *
  */
 private function constants()
 {
     // define plugin translation string
     if (!defined('BP_API_PLUGIN_SLUG')) {
         define('BP_API_PLUGIN_SLUG', 'bp_api');
     }
     // define api endpint prefix
     if (!defined('BP_API_SLUG')) {
         define('BP_API_SLUG', 'bp');
     }
     // Define a constant that can be checked to see if the component is installed or not.
     if (!defined('BP_API_IS_INSTALLED')) {
         define('BP_API_IS_INSTALLED', 1);
     }
     // Define a constant that will hold the current version number of the component
     // This can be useful if you need to run update scripts or do compatibility checks in the future
     if (!defined('BP_API_VERSION')) {
         define('BP_API_VERSION', '0.1');
     }
     // Define a constant that we can use to construct file paths and url
     if (!defined('BP_API_PLUGIN_DIR')) {
         define('BP_API_PLUGIN_DIR', trailingslashit(plugin_dir_path(__FILE__)));
     }
     if (!defined('BP_API_PLUGIN_URL')) {
         $plugin_url = plugin_dir_url(__FILE__);
         // If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
         if (is_ssl()) {
             $plugin_url = str_replace('http://', 'https://', $plugin_url);
         }
         define('BP_API_PLUGIN_URL', $plugin_url);
     }
 }
Exemplo n.º 8
0
 /**
  * Constructor.
  *
  *
  */
 public function __construct()
 {
     $this->plugin_url = plugins_url('/', __FILE__);
     $this->plugin_path = plugin_dir_path(__FILE__);
     $this->load_language('script-manager');
     add_action('plugins_loaded', array($this, 'init'));
 }
Exemplo n.º 9
0
function filebrowser_options_load()
{
    global $filebrowser_message, $gotofolder;
    $gotofolder = str_replace('\\', '/', ABSPATH);
    if (!current_user_can(10)) {
        wp_die('No rights');
    }
    //Css for Admin Section
    wp_enqueue_style('FileBrowser', plugins_url('/css/options.css', __FILE__), '', FILEBROWSER_VERSION, 'screen');
    if ($_GET['action'] == 'edit') {
        wp_enqueue_script('CodeMirror', plugins_url('/codemirror/js/codemirror.js', __FILE__), '', '0.70', false);
    }
    if ($_POST['action2'] != '-1') {
        $action = $_POST['action2'];
    }
    if ($_POST['action'] != '-1') {
        $action = $_POST['action'];
    }
    if (!empty($_GET['action']) and empty($action)) {
        $action = $_GET['action'];
    }
    //For change folder by hand
    if ($_POST['doactiongo'] == __('Go', 'filebrowser')) {
        if (@is_dir(str_replace('\\', '/', realpath($_POST['root'] . $_POST['newfolder'])))) {
            $gotofolder = str_replace('\\', '/', realpath($_POST['root'] . $_POST['newfolder']));
        } else {
            $gotofolder = $_POST['oldusedfolder'];
            $filebrowser_message = __('Could not jump to folder.', 'filebrowser');
        }
    }
    //For save Options
    require_once plugin_dir_path(__FILE__) . 'options-save.php';
}
Exemplo n.º 10
0
function easychangelog_require()
{
    $files = array('class-easychangelog', 'class-easychangelog-output', 'class-easychangelog-posttype', 'class-easychangelog-settings');
    foreach ($files as $file) {
        require plugin_dir_path(__FILE__) . 'includes/' . $file . '.php';
    }
}
Exemplo n.º 11
0
 function __construct()
 {
     if (!defined('PREMISE_VERSION')) {
         define('PREMISE_VERSION', '2.2.1');
         define('PREMISE_SETTINGS_FIELD', $this->_metakey_Settings);
         define('PREMISE_DIR', plugin_dir_path(__FILE__));
         define('PREMISE_URL', plugin_dir_url(__FILE__));
         define('PREMISE_BASENAME', plugin_basename(__FILE__));
         define('PREMISE_LIB_DIR', PREMISE_DIR . 'lib/');
         define('PREMISE_THEMES_DIR', PREMISE_DIR . 'themes/');
         define('PREMISE_THEMES_URL', PREMISE_URL . 'themes/');
         define('PREMISE_VIEWS_DIR', PREMISE_DIR . 'views/');
         define('PREMISE_RESOURCES_URL', PREMISE_URL . 'resources/');
         define('PREMISE_POST_TYPE', 'landing_page');
         define('PREMISE_MEMBER_DIR', PREMISE_DIR . 'member-access/');
         define('PREMISE_MEMBER_INCLUDES_DIR', PREMISE_MEMBER_DIR . 'includes/');
     }
     $settings = $this->get_settings();
     if (!empty($settings['main']['member-access']) && '1' == $settings['main']['member-access']) {
         require_once PREMISE_LIB_DIR . 'functions.php';
         require_once PREMISE_LIB_DIR . 'class-admin.php';
         require_once PREMISE_MEMBER_DIR . 'member-access.php';
     }
     $this->_use_premise_theme = empty($settings['main']['theme-support']) || $settings['main']['theme-support'] != '1';
     add_filter('generate_rewrite_rules', array($this, 'generate_rewrite_rules'));
     add_action('setup_theme', array($this, 'register_post_type'));
     if (!is_admin()) {
         add_action('setup_theme', array($this, 'setup_theme'), 11);
     }
     add_action('init', array($this, 'init'));
     add_action('update_option_' . $this->_option_DesignSettings, array($this, 'create_stylesheets'), 11, 2);
     add_filter('post_type_link', array($this, 'post_type_link'), 10, 3);
     load_plugin_textdomain('premise', false, '/premise/languages/');
 }
 /**
  * Constructor
  */
 function __construct()
 {
     $this->id = 'new_switch_order';
     $this->title = __('Subscription Switched', 'woocommerce-subscriptions');
     $this->description = __('Subscription switched emails are sent when a customer switches a subscription.', 'woocommerce-subscriptions');
     $this->heading = __('Subscription Switched', 'woocommerce-subscriptions');
     $this->subject = __('[{blogname}] Subscription Switched ({order_number}) - {order_date}', 'woocommerce-subscriptions');
     $this->template_html = 'emails/admin-new-switch-order.php';
     $this->template_plain = 'emails/plain/admin-new-switch-order.php';
     $this->template_base = plugin_dir_path(WC_Subscriptions::$plugin_file) . 'templates/';
     // Triggers for this email
     add_action('woocommerce_order_status_pending_to_processing_switch_notification', array($this, 'trigger'));
     add_action('woocommerce_order_status_pending_to_completed_switch_notification', array($this, 'trigger'));
     add_action('woocommerce_order_status_pending_to_on-hold_switch_notification', array($this, 'trigger'));
     add_action('woocommerce_order_status_failed_to_processing_switch_notification', array($this, 'trigger'));
     add_action('woocommerce_order_status_failed_to_completed_switch_notification', array($this, 'trigger'));
     add_action('woocommerce_order_status_failed_to_on-hold_switch_notification', array($this, 'trigger'));
     // We want all the parent's methods, with none of its properties, so call its parent's constructor, rather than my parent constructor
     WC_Email::__construct();
     // Other settings
     $this->recipient = $this->get_option('recipient');
     if (!$this->recipient) {
         $this->recipient = get_option('admin_email');
     }
 }
Exemplo n.º 13
0
 function __construct($plugin_file_path)
 {
     $this->load_settings();
     $this->maybe_schema_update();
     $this->plugin_file_path = $plugin_file_path;
     $this->plugin_dir_path = plugin_dir_path($plugin_file_path);
     $this->plugin_folder_name = basename($this->plugin_dir_path);
     $this->plugin_basename = plugin_basename($plugin_file_path);
     $this->template_dir = $this->plugin_dir_path . 'template' . DIRECTORY_SEPARATOR;
     $this->plugin_title = ucwords(str_ireplace('-', ' ', basename($plugin_file_path)));
     $this->plugin_title = str_ireplace(array('db', 'wp', '.php'), array('DB', 'WP', ''), $this->plugin_title);
     // We need to set $this->plugin_slug here because it was set here
     // in Media Files prior to version 1.1.2. If we remove it the customer
     // cannot upgrade, view release notes, etc
     // used almost exclusively as a identifier for plugin version checking (both core and addons)
     $this->plugin_slug = basename($plugin_file_path, '.php');
     // used to add admin menus and to identify the core version in the $GLOBALS['wpmdb_meta'] variable for delicious brains api calls, version checking etc
     $this->core_slug = $this->is_pro || $this->is_addon ? 'wp-migrate-db-pro' : 'wp-migrate-db';
     if (is_multisite()) {
         $this->plugin_base = 'settings.php?page=' . $this->core_slug;
     } else {
         $this->plugin_base = 'tools.php?page=' . $this->core_slug;
     }
     if ($this->is_addon || $this->is_pro) {
         $this->pro_addon_construct();
     }
     add_action('init', array($this, 'load_plugin_textdomain'));
 }
 /**
  * Initialize the plugin by loading admin scripts & styles and adding a
  * settings page and menu.
  *
  * @since     1.0.0
  */
 private function __construct()
 {
     /*
      * Call $plugin_slug from public plugin class.
      *
      * TODO:
      *
      * - Rename "Really_Big_Files" to the name of your initial plugin class
      *
      */
     $plugin = Really_Big_Files::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Add the options page and menu item.
     add_action('admin_menu', array($this, 'add_plugin_admin_menu'));
     add_action('admin_init', array($this, 'register_rbfsettings'));
     // Add an action link pointing to the options page.
     $plugin_basename = plugin_basename(plugin_dir_path(__FILE__) . $this->plugin_slug . '.php');
     add_filter('plugin_action_links_' . $plugin_basename, array($this, 'add_action_links'));
     /*
      * Define custom functionality.
      *
      * Read more about actions and filters:
      * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
      */
     add_action('TODO', array($this, 'action_method_name'));
     add_filter('TODO', array($this, 'filter_method_name'));
 }
Exemplo n.º 15
0
function cf_slack_register_processor($pr)
{
    $pr['slack'] = array("name" => __('Slack: Message', 'cf-slack'), "description" => __("Post a message to slack on submission", 'cf-slack'), "author" => 'David Cramer', "author_url" => 'https://Calderawp.com', "icon" => plugin_dir_url(__FILE__) . "icon.png", "processor" => 'cf_send_slack_message', "template" => plugin_dir_path(__FILE__) . "config.php");
    //@since 1.1.0
    $pr['slack-invite'] = array("name" => __('Slack: Invite', 'cf-slack'), "description" => __("Send a Slack Invite", 'cf-slack'), "author" => 'Josh Pollock', "author_url" => 'https://Calderawp.com', "icon" => plugin_dir_url(__FILE__) . "icon.png", "processor" => 'cf_slack_send_invite', "template" => plugin_dir_path(__FILE__) . "config-invite.php");
    return $pr;
}
Exemplo n.º 16
0
 function __construct()
 {
     $this->module_dir = plugin_dir_path(__FILE__) . 'modules/';
     add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'front_scripts'), 1);
     add_action('admin_init', array($this, 'generate_shortcode_params'));
 }
 public static function init_hooks()
 {
     // The standalone stats page was removed in 3.0 for an all-in-one config and stats page.
     // Redirect any links that might have been bookmarked or in browser history.
     if (isset($_GET['page']) && 'akismet-stats-display' == $_GET['page']) {
         wp_safe_redirect(esc_url_raw(self::get_page_url('stats')), 301);
         die;
     }
     self::$initiated = true;
     add_action('admin_init', array('Akismet_Admin', 'admin_init'));
     add_action('admin_menu', array('Akismet_Admin', 'admin_menu'), 5);
     # Priority 5, so it's called before Jetpack's admin_menu.
     add_action('admin_notices', array('Akismet_Admin', 'display_notice'));
     add_action('admin_enqueue_scripts', array('Akismet_Admin', 'load_resources'));
     add_action('activity_box_end', array('Akismet_Admin', 'dashboard_stats'));
     add_action('rightnow_end', array('Akismet_Admin', 'rightnow_stats'));
     add_action('manage_comments_nav', array('Akismet_Admin', 'check_for_spam_button'));
     add_action('transition_comment_status', array('Akismet_Admin', 'transition_comment_status'), 10, 3);
     add_action('admin_action_akismet_recheck_queue', array('Akismet_Admin', 'recheck_queue'));
     add_action('wp_ajax_akismet_recheck_queue', array('Akismet_Admin', 'recheck_queue'));
     add_action('wp_ajax_comment_author_deurl', array('Akismet_Admin', 'remove_comment_author_url'));
     add_action('wp_ajax_comment_author_reurl', array('Akismet_Admin', 'add_comment_author_url'));
     add_filter('plugin_action_links', array('Akismet_Admin', 'plugin_action_links'), 10, 2);
     add_filter('comment_row_actions', array('Akismet_Admin', 'comment_row_action'), 10, 2);
     add_filter('comment_text', array('Akismet_Admin', 'text_add_link_class'));
     add_filter('plugin_action_links_' . plugin_basename(plugin_dir_path(__FILE__) . 'akismet.php'), array('Akismet_Admin', 'admin_plugin_settings_link'));
 }
Exemplo n.º 18
0
 function Acf()
 {
     // vars
     $this->path = plugin_dir_path(__FILE__);
     $this->dir = plugins_url('', __FILE__);
     $this->version = '3.5.0';
     $this->upgrade_version = '3.4.1';
     // this is the latest version which requires an upgrade
     $this->cache = array();
     // basic array cache to hold data throughout the page load
     // set text domain
     load_plugin_textdomain('acf', false, basename(dirname(__FILE__)) . '/lang');
     // controllers
     $this->setup_controllers();
     // actions
     add_action('init', array($this, 'init'));
     add_filter('post_updated_messages', array($this, 'post_updated_messages'));
     add_filter('manage_edit-acf_columns', array($this, 'acf_columns_filter'));
     add_action('admin_menu', array($this, 'admin_menu'));
     add_action('admin_head', array($this, 'admin_head'));
     add_action('acf_save_post', array($this, 'acf_save_post'), 10);
     // save post, called from many places (api, input, everything, options)
     // ajax
     add_action('wp_ajax_get_input_metabox_ids', array($this, 'get_input_metabox_ids'));
     return true;
 }
Exemplo n.º 19
0
 private function __construct($slug)
 {
     $this->_slug = $slug;
     $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $slug, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
     $bt = debug_backtrace();
     $i = 1;
     while ($i < count($bt) - 1 && false !== strpos($bt[$i]['file'], DIRECTORY_SEPARATOR . 'freemius' . DIRECTORY_SEPARATOR)) {
         $i++;
     }
     $this->_plugin_main_file_path = $bt[$i]['file'];
     $this->_plugin_dir_path = plugin_dir_path($this->_plugin_main_file_path);
     $this->_plugin_basename = plugin_basename($this->_plugin_main_file_path);
     $this->_plugin_data = get_plugin_data($this->_plugin_main_file_path);
     $base_name_split = explode('/', $this->_plugin_basename);
     $this->_plugin_dir_name = $base_name_split[0];
     if ($this->_logger->is_on()) {
         $this->_logger->info('plugin_main_file_path = ' . $this->_plugin_main_file_path);
         $this->_logger->info('plugin_dir_path = ' . $this->_plugin_dir_path);
         $this->_logger->info('plugin_basename = ' . $this->_plugin_basename);
         $this->_logger->info('plugin_dir_name = ' . $this->_plugin_dir_name);
     }
     // Hook to plugin activation
     register_activation_hook($this->_plugin_main_file_path, array(&$this, '_activate_plugin_event'));
     // Hook to plugin uninstall.
     register_uninstall_hook($this->_plugin_main_file_path, array('Freemius', '_uninstall_plugin'));
     $this->_load_account();
 }
Exemplo n.º 20
0
function ft_op_init()
{
    if (!file_exists(get_template_directory() . '/ft-options.php')) {
        return;
    }
    //  If user can't edit theme options, exit
    if (!current_user_can('edit_theme_options')) {
        return;
    }
    // Load translation files
    load_plugin_textdomain('ft_optionsframework', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    // Loads the required Options Framework classes.
    require plugin_dir_path(__FILE__) . 'includes/class-options-framework.php';
    require plugin_dir_path(__FILE__) . 'includes/class-options-framework-admin.php';
    require plugin_dir_path(__FILE__) . 'includes/class-options-interface.php';
    require plugin_dir_path(__FILE__) . 'includes/class-options-media-uploader.php';
    require plugin_dir_path(__FILE__) . 'includes/class-options-sanitization.php';
    // Instantiate the main plugin class.
    $options_framework = new FT_OP();
    $options_framework->init();
    // Instantiate the options page.
    $options_framework_admin = new FT_OP_Admin();
    $options_framework_admin->init();
    // Instantiate the media uploader class
    $options_framework_media_uploader = new FT_OP_Media_Uploader();
    $options_framework_media_uploader->init();
}
Exemplo n.º 21
0
 public function admin_plugin_dir()
 {
     if ($this->admin_plugin_dir) {
         return $this->admin_plugin_dir;
     }
     return $this->admin_plugin_dir = untrailingslashit(plugin_dir_path(__FILE__));
 }
Exemplo n.º 22
0
 /**
  * Konstruktor der Klasse
  *
  * @since   0.1
  * @change  0.1
  */
 public static function init()
 {
     /* Optionen */
     $options = get_option('toolbox');
     /* Sicherheit */
     if (!empty($options['secure'])) {
         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE or defined('DOING_CRON') && DOING_CRON or defined('DOING_AJAX') && DOING_AJAX or defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
             return;
         }
     }
     /* Init */
     self::$plugin_path = plugin_basename(__FILE__);
     self::$modules_path = plugin_dir_path(__FILE__) . 'modules/';
     /* Module einbinden */
     self::_require_modules($options);
     /* Backend */
     if (is_admin()) {
         add_action('wpmu_new_blog', array(__CLASS__, 'install_later'));
         add_action('delete_blog', array(__CLASS__, 'uninstall_later'));
         add_action('admin_init', array(__CLASS__, 'register_settings'));
         add_action('admin_menu', array(__CLASS__, 'add_page'));
         add_filter('plugin_row_meta', array(__CLASS__, 'row_meta'), 10, 2);
         add_filter('plugin_action_links_' . self::$plugin_path, array(__CLASS__, 'action_links'));
     }
 }
 /**
  * constructor
  */
 function HW_Taxonomy_Post_List_widget()
 {
     //Hoangweb Taxonomy Post List
     parent::WP_Widget(false, $name = "Truy xuất nội dung theo chuyên mục", array('description' => 'Hiển thị bài viết theo danh mục/taxonomy'));
     //you should check if whether this widget actived on frontend or neither maybe you can get widget data by get_option($this->option_name)
     if (!is_admin() && !is_active_widget(false, false, $this->id_base, true)) {
         return;
     }
     $this->setup_actions();
     //instance skin
     if (class_exists('HW_SKIN')) {
         $this->skin = new HW_SKIN($this, plugin_dir_path(__FILE__), self::SKINS_FOLDER, 'hw-category-posts.php', 'skins');
         //$this->skin->skin_name='hw-category-posts.php';   #/wp-contents/hw_yahooskype/yahooskype.php
         //$this->skin->skin_folder='wcp_hw_skins';   #create folder in /wp-contents/hw_yahooskype
         $this->skin->plugin_url = plugins_url('', __FILE__);
         $this->skin->enable_external_callback = false;
         $this->skin->create('pagination', '__paginations', 'hwtpl-pagination.php')->enable_external_callback = false;
         //create new skin for pagination
         //create scrollbar skins
         $this->skin->create('scrollbar', '__scrollbars', 'hwtpl-scrollbar.php')->enable_external_callback = false;
         $this->skin->enable_template_engine();
     }
     self::$instance = $this;
     //save lastest instance of this widget
     //register widget features from HW_AWC
     if (class_exists('HW_AWC')) {
         /*HW_AWC::register_widget_feature($this,'grid_posts');  //depricated
           HW_AWC::register_widget_feature($this, 'saveconfig');
           HW_AWC::register_widget_feature($this, 'fancybox');*/
     }
     $this->hwtpl = new HW_Taxonomy_Post_List();
     $this->hwtpl->localize_object_callback = array($this, '_set_localize_scripts_data');
 }
 /**
  * Constructor.
  *
  * @since 1.0.0
  */
 public function __construct()
 {
     if (!function_exists('is_plugin_active_for_network')) {
         require_once ABSPATH . '/wp-admin/includes/plugin.php';
     }
     // Check if WooCommerce is active
     if (!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         if (!is_plugin_active_for_network('woocommerce/woocommerce.php')) {
             return;
         }
     }
     // Check if WooCommerce Advanced Shipping is active
     if (!in_array('woocommerce-advanced-shipping/woocommerce-advanced-shipping.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         if (!is_plugin_active_for_network('woocommerce-advanced-shipping/woocommerce-advanced-shipping.php')) {
             return;
         }
     }
     // Add zone to conditions list
     add_filter('was_conditions', array($this, 'was_conditions_add_zones'), 10, 1);
     // Add zone to values list
     add_filter('was_values', array($this, 'was_values_add_zones'), 10, 2);
     // Add description to zone condition
     add_filter('was_descriptions', array($this, 'was_descriptions_zones'));
     // Match zones
     add_filter('was_match_condition_zones', array($this, 'was_match_condition_zones'), 10, 3);
     // Enqueue scripts
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     // Settings page
     require_once 'includes/class-wasz-settings.php';
     $this->settings = new WASZ_Settings();
     // Post type
     require_once plugin_dir_path(__FILE__) . 'includes/class-wasz-post-type.php';
     $this->post_type = new WASZ_Post_Type();
 }
 function __construct($plugin_file_path)
 {
     $this->plugin_file_path = $plugin_file_path;
     $this->plugin_dir_path = rtrim(plugin_dir_path($plugin_file_path), '/');
     $this->plugin_basename = plugin_basename($plugin_file_path);
     $this->plugin_version = $GLOBALS['afro_meta'][$this->plugin_slug]['version'];
 }
 function plugin_url()
 {
     if ($this->plugin_url) {
         return $this->plugin_url;
     }
     return $this->plugin_url = plugins_url(basename(plugin_dir_path(__FILE__)), basename(__FILE__));
 }
Exemplo n.º 27
0
function st_getExtras($smart_button)
{
    $dir = plugin_dir_path(__FILE__) . 'images/Extras/buttons/';
    if ($smart_button == '0') {
        $opa = 'style="opacity: 1; filter: alpha(opacity=100);"';
    } else {
        $opa = 'style="opacity: .2; filter: alpha(opacity=2);"';
    }
    $extras = '<img class="st-smart-buttons" ' . $opa . ' src="' . plugins_url('images/Extras/buttons/standard.png', __FILE__) . '" alt="" data-pid="0" /><br>';
    $i = 0;
    $files = scandir($dir);
    foreach ($files as $file) {
        if ($file != '.' && $file != '..' && $file != 'standard.png') {
            $i++;
            if ($smart_button === $file) {
                $opa = 'style="opacity: 1; filter: alpha(opacity=100);"';
            } else {
                $opa = '';
            }
            $extras .= '<img class="st-smart-buttons" ' . $opa . ' src="' . plugins_url('images/Extras/buttons/' . $file, __FILE__) . '" alt="" data-pid="' . $file . '" />';
            if ($i == 3) {
                $extras .= '<br>';
                $i = 0;
            }
        }
    }
    return $extras;
}
Exemplo n.º 28
0
 /**
  * Define Meta Slider constants
  */
 private function define_constants()
 {
     define('METASLIDER_VERSION', $this->version);
     define('METASLIDER_BASE_URL', trailingslashit(plugins_url('ml-slider')));
     define('METASLIDER_ASSETS_URL', trailingslashit(METASLIDER_BASE_URL . 'assets'));
     define('METASLIDER_PATH', plugin_dir_path(__FILE__));
 }
Exemplo n.º 29
0
 function sectioned_page_output()
 {
     wp_enqueue_script('sticky', WP_PLUGIN_URL . '/' . plugin_dir_path('msd-specialty-pages/msd-specialty-pages.php') . '/lib/js/jquery.sticky.js', array('jquery'), FALSE, TRUE);
     global $post, $subtitle_metabox, $sectioned_page_metabox, $nav_ids;
     $i = 0;
     $meta = $sectioned_page_metabox->the_meta();
     if (is_object($sectioned_page_metabox)) {
         while ($sectioned_page_metabox->have_fields('sections')) {
             $layout = $sectioned_page_metabox->get_the_value('layout');
             switch ($layout) {
                 case "three-boxes":
                     break;
                 default:
                     $sections[] = self::default_output($meta['sections'][$i], $i);
                     break;
             }
             $i++;
         }
         //close while
         print '<div class="sectioned-page-wrapper">';
         print implode("\n", $sections);
         print '</div>';
     }
     //clsoe if
 }
Exemplo n.º 30
-1
 function __construct()
 {
     $this->the_path = plugin_dir_path(__FILE__);
     $this->the_url = plugin_dir_url(__FILE__);
     $this->icon_size = get_option('msdsocial_icon_size') ? get_option('msdsocial_icon_size') : '0';
     $this->ver = '0.9.6';
     /*
      * Pull in some stuff from other files
      */
     //$this->requireDir($this->the_path . 'lib/inc');
     require_once $this->the_path . 'lib/inc/settings.php';
     require_once $this->the_path . 'lib/inc/widgets.php';
     if (!is_admin()) {
         wp_enqueue_style('msd-social-style', $this->the_url . 'lib/css/style.css');
         wp_enqueue_style('msd-social-style-' . $this->icon_size, $this->the_url . 'lib/css/style' . $this->icon_size . '.css');
         wp_enqueue_style('font-awesome-style', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css');
     }
     add_action('admin_enqueue_scripts', array(&$this, 'add_admin_scripts'));
     add_action('admin_enqueue_scripts', array(&$this, 'add_admin_styles'));
     add_action('wp_head', array(&$this, 'setup_notification_bar'));
     add_shortcode('msd-address', array(&$this, 'get_address'));
     add_shortcode('msd-additional-locations', array(&$this, 'get_additional_locations'));
     add_shortcode('msd-all-locations', array(&$this, 'get_all_locations'));
     add_shortcode('msd-bizname', array(&$this, 'get_bizname'));
     add_shortcode('msd-copyright', array(&$this, 'get_copyright'));
     add_shortcode('msd-digits', array(&$this, 'get_digits'));
     add_shortcode('msd-social', array(&$this, 'social_media'));
     add_shortcode('msd-hours', array(&$this, 'get_hours'));
 }