本文整理汇总了PHP中PucFactory类的典型用法代码示例。如果您正苦于以下问题:PHP PucFactory类的具体用法?PHP PucFactory怎么用?PHP PucFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PucFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: set_up_auto_updater
function set_up_auto_updater()
{
$forceUpdate = get_option('force-jetpack-update');
if ($forceUpdate != get_current_jetpack_version()) {
update_option('force-jetpack-update', 'just-updated');
}
$beta_type = get_option('jp_beta_type');
if ($beta_type == 'rc_only') {
$json_url = 'http://betadownload.jetpack.me/rc/rc.json';
} else {
$json_url = 'http://betadownload.jetpack.me/jetpack-bleeding-edge.json';
}
do_action('add_debug_info', $json_url, 'json_url');
require 'plugin-updates/plugin-update-checker.php';
$JetpackBeta = PucFactory::buildUpdateChecker($json_url, WP_PLUGIN_DIR . '/jetpack/jetpack.php', 'jetpack', '0.01');
// Allows us to update the Jetpack Beta tool by updating GitHub
$className = PucFactory::getLatestClassVersion('PucGitHubChecker');
$myUpdateChecker = new $className('https://github.com/Automattic/jetpack-beta/', __FILE__, 'master');
$jp_beta_autoupdate = get_option('jp_beta_autoupdate');
if ($jp_beta_autoupdate != 'no') {
function auto_update_jetpack_beta($update, $item)
{
// Array of plugin slugs to always auto-update
$plugins = array('jetpack');
if (in_array($item->slug, $plugins)) {
return true;
// Always update plugins in this array
} else {
return $update;
// Else, use the normal API response to decide whether to update or not
}
}
add_filter('auto_update_plugin', 'auto_update_jetpack_beta', 10, 2);
}
}
开发者ID:Ramoonus,项目名称:jetpack-beta,代码行数:35,代码来源:jetpack-beta.php
示例2: __construct
public function __construct()
{
if (is_admin()) {
$this->loadSettings();
}
//Capture request arguments before WP has had a chance to apply magic quotes.
$this->get = $_GET;
$this->post = $this->originalPost = $_POST;
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$this->post = stripslashes_deep($this->post);
$this->get = stripslashes_deep($this->get);
}
add_action('wp_before_admin_bar_render', array($this, 'filterAdminBar'), self::ADMIN_BAR_FILTER_PRIORITY);
add_action('admin_menu', array($this, 'addEditorPage'));
if (!defined('IS_DEMO_MODE') && !defined('IS_MASTER_MODE')) {
//Add-ons are updated separately from the main plugin, but use the same license details.
require WS_ADMIN_BAR_EDITOR_DIR . '/includes/plugin-updates/plugin-update-checker.php';
$this->updateChecker = PucFactory::buildUpdateChecker('http://adminmenueditor.com/?get_metadata_for=wp-toolbar-editor', WS_ADMIN_BAR_EDITOR_FILE, 'wp-toolbar-editor', 12, 'ws_abe_external_updates');
if (isset($GLOBALS['ameProLicenseManager'])) {
$this->ameLicenseManager = $GLOBALS['ameProLicenseManager'];
$this->updateChecker->addQueryArgFilter(array($this, 'filterUpdateChecks'));
$downloadFilter = array($this, 'filterUpdateDownloadUrl');
$this->updateChecker->addFilter('request_info_result', $downloadFilter, 20);
$this->updateChecker->addFilter('pre_inject_update', $downloadFilter);
$this->updateChecker->addFilter('pre_inject_info', $downloadFilter);
}
}
}
开发者ID:thejimbirch,项目名称:randy,代码行数:28,代码来源:AdminBarEditor.php
示例3: check_for_updates
/**
* Checks for plugin updates.
*/
public function check_for_updates($plugin_file, $plugin_slug = null)
{
if (empty($plugin_slug)) {
$plugin_slug = static::$plugin_slug;
}
// Debug
//var_dump($this->path('vendor') . '/yahnis-elsts/plugin-update-checker/plugin-update-checker.php');die();
require_once $this->path('vendor') . '/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
$MyUpdateChecker = \PucFactory::buildUpdateChecker($this->get_update_url($plugin_slug), $plugin_file, $plugin_slug);
}
开发者ID:keshvenderg,项目名称:cloudshop,代码行数:13,代码来源:aelia-plugin.php
示例4: __construct
public function __construct($slug, $dir, $file, $debug = false)
{
$this->slug = $slug;
$this->debug = $debug;
$this->license_server_url = 'http://lic.codemshop.com/manager_' . $this->rev;
$this->update_server_url = 'http://lic.codemshop.com/update';
require 'plugin-updates/plugin-update-checker.php';
$license_info = get_option('msl_license_' . $this->slug, null);
if ($license_info) {
$license_info = json_decode($license_info);
}
$this->update_checker = PucFactory::buildUpdateChecker($this->update_server_url . '?action=get_metadata&slug=' . $this->slug . '&license_key=' . ($license_info ? $license_info->license_key : '') . '&activation_key=' . ($license_info ? $license_info->activation_key : '') . '&domain=' . ($license_info ? $license_info->site_url : ''), $file, $this->slug);
add_action("in_plugin_update_message-" . basename($dir) . '/' . basename($file), array($this, "in_plugin_update_message"), 10, 2);
add_action('wp_ajax_msl_activation_' . $this->slug, array(&$this, 'msl_activation'));
add_action('wp_ajax_msl_verify_' . $this->slug, array(&$this, 'msl_verify'));
add_action('wp_ajax_msl_reset_' . $this->slug, array(&$this, 'msl_reset'));
add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
}
开发者ID:ksw2342,项目名称:kau_webstudio_12,代码行数:18,代码来源:LicenseManager.php
示例5: includes
private function includes()
{
global $klikbayi_settings, $klikbayi_sanitize;
require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-sanitize.php';
require_once KLIKBAYI_PATH_LIB . 'inc/settings.php';
$klikbayi_sanitize = klikbayi_sanitize();
$klikbayi_settings = klikbayi_settings();
require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-load.php';
require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-widget.php';
if (is_admin()) {
require_once ABSPATH . 'wp-includes/pluggable.php';
if (current_user_can('manage_options')) {
require KLIKBAYI_PATH_LIB . 'inc/updates/plugin-update-checker/plugin-update-checker.php';
$className = PucFactory::getLatestClassVersion('PucGitHubChecker');
$myUpdateChecker = new $className('https://github.com/Jevuska/klikbayi/', KLIKBAYI_PLUGIN_FILE, 'master');
require_once KLIKBAYI_PATH_LIB . 'inc/admin-function.php';
require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-admin.php';
require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-setup.php';
do_action('load-klikbayi-admin-page');
}
} else {
}
require_once KLIKBAYI_PATH_LIB . 'install.php';
}
开发者ID:extremelyanca,项目名称:klikbayi,代码行数:24,代码来源:klikbayi.php
示例6: header
//Enable browser caching.
header('Cache-Control: public');
header('Expires: Thu, 31 Dec ' . date('Y', strtotime('+1 year')) . ' 23:59:59 GMT');
header('Pragma: cache');
echo $custom_menu['color_css'];
exit;
}
}
if (isset($wp_menu_editor) && !defined('WP_UNINSTALL_PLUGIN')) {
//Initialize extras
$wsMenuEditorExtras = new wsMenuEditorExtras($wp_menu_editor);
}
if (!defined('IS_DEMO_MODE') && !defined('IS_MASTER_MODE')) {
//Load the custom update checker (requires PHP 5)
if (version_compare(PHP_VERSION, '5.0.0', '>=') && isset($wp_menu_editor)) {
require dirname(__FILE__) . '/plugin-updates/plugin-update-checker.php';
$ameProUpdateChecker = PucFactory::buildUpdateChecker('http://adminmenueditor.com/?get_metadata_for=admin-menu-editor-pro', $wp_menu_editor->plugin_file, 'admin-menu-editor-pro', 12, 'ame_pro_external_updates', 'admin-menu-editor-mu.php');
//Hack. See PluginUpdateChecker::installHooks().
function wsDisableAmeCron()
{
wp_clear_scheduled_hook('check_plugin_updates-admin-menu-editor-pro');
}
register_deactivation_hook($wp_menu_editor->plugin_file, 'wsDisableAmeCron');
}
//Load the license manager.
require dirname(__FILE__) . '/license-manager/LicenseManager.php';
$ameProLicenseManager = new Wslm_LicenseManagerClient(array('api_url' => 'http://adminmenueditor.com/licensing_api/', 'product_slug' => 'admin-menu-editor-pro', 'license_scope' => Wslm_LicenseManagerClient::LICENSE_SCOPE_NETWORK, 'update_checker' => isset($ameProUpdateChecker) ? $ameProUpdateChecker : null));
if (isset($wp_menu_editor)) {
$ameLicensingUi = new Wslm_BasicPluginLicensingUI($ameProLicenseManager, $wp_menu_editor->plugin_file);
}
}
开发者ID:thejimbirch,项目名称:randy,代码行数:31,代码来源:extras.php
示例7: auto_update_wa_fronted
Plugin Name: WA-Fronted
Plugin URI: http://github.com/jesperbjerke/wa-fronted
Description: Edit content directly from fronted in the contents actual place
Version: 1.2.1
Text Domain: wa-fronted
Domain Path: /languages
Author: Jesper Bjerke
Author URI: http://www.westart.se
Network: True
License: GPLv2
*/
/**
* Plugin updater curtesy of @link https://github.com/YahnisElsts
*/
require_once 'plugin-update-checker/plugin-update-checker.php';
$Plugin_Updater = PucFactory::getLatestClassVersion('PucGitHubChecker');
$WA_Fronted_Updater = new $Plugin_Updater('https://github.com/jesperbjerke/wa-fronted/', __FILE__, 'master');
/**
* Enable automatic background updates for this plugin
*/
function auto_update_wa_fronted($update, $item)
{
// Array of plugin slugs to always auto-update
$plugins = array('wa-fronted');
if (in_array($item->slug, $plugins)) {
return true;
// Always update plugins in this array
} else {
return $update;
// Else, use the normal API response to decide whether to update or not
}
开发者ID:r-a-y,项目名称:wa-fronted,代码行数:31,代码来源:wa-fronted.php
示例8: add_action
<?php
add_action("ps_extras", "show_simpli_iframe");
function show_simpli_iframe()
{
echo '<iframe name="simpli" style="height: 700px; width: 100%" src="http://simpli.padsquad.com" frameborder="0" scrolling="no" id="iframe"/>';
}
add_action("ps_beta_fields", "show_beta_fields");
function show_beta_fields()
{
add_settings_field("ps_beta_toggle", "Beta", "beta_radio", "psplugin_advanced", "section_advanced");
register_setting("section_advanced", "ps_command_line_beta");
register_setting("section_advanced", "ps_beta_toggle");
}
require 'plugin-updates/plugin-update-checker.php';
if (get_option("ps_beta_toggle") == "on") {
update_option("ps_update_url", 'http://asset.padsquad.com/wpplugin/update_beta.json');
$MyUpdateChecker = PucFactory::buildUpdateChecker(get_option("ps_update_url"), plugin_dir_path(__FILE__) . "padsquad.php", 'padsquad');
} else {
update_option("ps_update_url", 'http://asset.padsquad.com/wpplugin/update.json');
$MyUpdateChecker = PucFactory::buildUpdateChecker(get_option("ps_update_url"), plugin_dir_path(__FILE__) . "padsquad.php", 'padsquad');
}
开发者ID:kryptonite303,项目名称:PSPlugin,代码行数:22,代码来源:ps_extras.php
示例9: enableAutoUpdates
/**
* Install AutoUpdates
*/
public function enableAutoUpdates()
{
// This buyer is already checked
$isChecked = get_option($this->slugfy('is-checked'));
// Check if it's checked
if ($isChecked) {
// Requiring library
require $this->path('inc/updater/plugin-update-checker.php', true);
// Instantiating it
$updateChecker = PucFactory::buildUpdateChecker($this->config['updatesURL'], $this->config['file'], $this->config['fullSlug']);
}
// end if;
}
开发者ID:AndyMarkle,项目名称:rocket,代码行数:16,代码来源:paradox.php
示例10: wp_enqueue_script
wp_enqueue_script('media-upload');
wp_enqueue_style('wp-color-picker');
wp_register_script('jquery-validation-plugin', '//ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js');
wp_register_script('jquery-validation-additional-methods-plugin', '//jqueryvalidation.org/files/dist/additional-methods.min.js');
wp_enqueue_script($this->name . '-admin', $this->plugin_url . 'js/admin.js', array('jquery', 'jquery-validation-plugin', 'jquery-validation-additional-methods-plugin', 'jquery-ui-tooltip', 'jquery-ui-core', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-accordion', 'wp-color-picker'), false, false);
wp_localize_script($this->name . '-admin', 'tc_vars', array('ajaxUrl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'animated_transitions' => apply_filters('tc_animated_transitions', true), 'delete_confirmation_message' => __('Please confirm that you want to delete it permanently?', 'tc'), 'order_status_changed_message' => __('Order status changed successfully.', 'tc')));
wp_enqueue_script($this->name . '-chosen', $this->plugin_url . 'js/chosen.jquery.min.js', array($this->name . '-admin'), false, false);
wp_enqueue_style($this->name . '-admin', $this->plugin_url . 'css/admin.css', array(), $this->version);
wp_enqueue_style($this->name . '-admin-jquery-ui', '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css', array(), $this->version);
wp_enqueue_style($this->name . '-chosen', $this->plugin_url . 'css/chosen.min.css', array(), $this->version);
wp_enqueue_script($this->name . '-simple-dtpicker', $this->plugin_url . 'js/jquery.simple-dtpicker.js', array('jquery'), $this->version);
wp_enqueue_style($this->name . '-simple-dtpicker', $this->plugin_url . 'css/jquery.simple-dtpicker.css', array(), $this->version);
wp_enqueue_style('font-awesome', $this->plugin_url . '/css/font-awesome.min.css', array(), $this->version);
}
}
global $tc, $license_key;
$tc = new TC();
}
$tc_general_settings = get_option('tc_general_setting', false);
if (!defined('TC_NU')) {
//updates are allowed
$license_key = defined('TC_LCK') && TC_LCK !== '' ? TC_LCK : (isset($tc_general_settings['license_key']) && $tc_general_settings['license_key'] !== '' ? $tc_general_settings['license_key'] : '');
$addon_slug = 'tickera';
if ($license_key !== '') {
$updater_file = $tc->plugin_dir . 'includes/plugin-update-checker/plugin-update-checker.php';
if (file_exists($updater_file)) {
require_once $updater_file;
$tc_plugin_update_checker = PucFactory::buildUpdateChecker('https://tickera.com/update/?action=get_metadata&slug=' . $addon_slug, __FILE__, $addon_slug, 1);
}
}
}
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:31,代码来源:tickera.php
示例11: add_filter
}
}
add_filter('pp_settings_api_filter', array(&$this, 'pp_settings_api_filter'), 100, 1);
add_action('pp_settings_api_reset', array(&$this, 'pp_settings_api_reset'), 100, 1);
add_action('init', array(&$this, 'init'), 1);
add_action('wp', array(&$this, 'wp'));
add_action('generate_rewrite_rules', array(&$this, 'add_rewrite_rules'));
add_filter('404_template', array(&$this, 'custom_404_page'), 10, 1);
add_filter('the_content', array(&$this, 'post_filter'));
add_action('admin_notices', array(&$this, 'admin_notices'));
if (isset($_GET['die_message']) && is_admin()) {
add_action('admin_init', array(&$this, 'die_message'), 1000);
}
if ((is_admin() || $can_deactive) && $this->opt('li')) {
require 'lib/plugin-updates/plugin-update-checker.php';
$HMWP_UpdateChecker = PucFactory::buildUpdateChecker('http://api.wpwave.com/hide_my_wp.json', __FILE__, 'hide_my_wp', 120);
$HMWP_UpdateChecker->addQueryArgFilter(array(&$this, 'update_attr'));
}
//compatibility with social login
if ($this->opt('disable_directory_listing')) {
defined('WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL') || define('WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL', plugins_url() . '/wordpress-social-login');
defined('WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL') || define('WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL', WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL . '/hybridauth/index.php');
}
if (is_multisite()) {
add_action('network_admin_notices', array(&$this, 'admin_notices'));
}
if ($this->opt('antispam')) {
add_action('pre_comment_on_post', array(&$this, 'spam_blocker'), 1);
add_action('comment_form_default_fields', array(&$this, 'spam_blocker_fake_field'), 1000);
}
if (!$can_deactive && $this->h->ends_with($_SERVER['PHP_SELF'], 'customize.php')) {
开发者ID:andrewkhunn,项目名称:lancero,代码行数:31,代码来源:load.php
示例12: define
define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins');
}
$wp_dir = __FILE__;
$wp_dir = str_replace("\\", "/", $wp_dir);
$wp_dir = explode("/", $wp_dir);
$index = count($wp_dir) - 2;
$pluginfolder = $wp_dir[$index];
$url = WP_PLUGIN_URL;
if (substr_count(admin_url(), "https://") > 0 && substr_count($url, "https://") <= 0) {
$url = str_replace("http://", "https://", $url);
}
define('IMSCPB_SLUG', $pluginfolder);
define('IMSCPB_DIR', WP_PLUGIN_DIR . "/" . $pluginfolder);
define('IMSCPB_URL', $url . "/" . $pluginfolder);
require_once 'functions/plugin-update-checker.php';
$imscpb_uc = PucFactory::buildUpdateChecker('http://wpprofitbuilder.com/download/profit_builder_lite/profit_builder_lite.json', IMSCPB_FILE, 'profit-builder-lite', 12);
global $pbuilder;
$pbuilder = new ProfitBuilder(IMSCPB_FILE);
class ProfitBuilder
{
var $main, $path, $name, $url, $menu_controls, $row_controls, $shortcodes, $rows, $icons, $showall, $yoast, $hideifs, $groups;
var $standard_fonts = array("Arial", "Arial+Black", "Tahoma", "Trebuchet+MS", "Verdana", "Century+Gothic", "Geneva", "Lucida", "Lucida+Sans", "Lucida+Grande", "Courier", "Courier+New", "Georgia", "Times", "Times+New+Roman", "MS+Serif", "New+York", "Palatino", "Palatino+Linotype", "Courier", "Courier+New", "Lucida+Console", "Monaco", "Helvetica", "Impact");
var $standard_fonts_variants = array("regular", "italic");
function __construct($file)
{
$this->main = $file;
$this->set_memory_limit();
$this->init();
return $this;
}
function init()
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:profit_builder_class.php
示例13: plugin_dir_path
5.1 - Functions
-------------------------------------------*/
require_once plugin_dir_path(__FILE__) . '/functions/global.php';
/*-------------------------------------------
5.2 - Register: CSS
-------------------------------------------*/
require_once plugin_dir_path(__FILE__) . '/functions/register-css.php';
/*-------------------------------------------
5.3 - Register: JS
-------------------------------------------*/
require_once plugin_dir_path(__FILE__) . '/functions/register-js.php';
/*-------------------------------------------
5.4 - Update Checker
-------------------------------------------*/
require plugin_dir_path(__FILE__) . '/assets/plugins/update-checker/plugin-update-checker.php';
$MyUpdateChecker = PucFactory::buildUpdateChecker('http://repo.strictthemes.com/?action=get_metadata&slug=stkit', __FILE__, 'stkit');
/*= 6 ===========================================
C O M P O N E N T S
Includings
===============================================*/
/*-------------------------------------------
6.1 - Shortcodes
-------------------------------------------*/
if ($st_Options['shortcodes']['status']) {
if (empty($st_Settings['shortcodes']) || isset($st_Settings['shortcodes']) && $st_Settings['shortcodes'] != 'no') {
require_once plugin_dir_path(__FILE__) . '/components/shortcodes/component.php';
}
}
/*-------------------------------------------
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:31,代码来源:stkit.php
示例14: initGithubUpdater
public function initGithubUpdater()
{
// Add some translations
add_filter('puc_manual_check_link-buzz-seo', function () {
return '';
}, 10, 0);
add_filter('puc_manual_check_message-buzz-seo', function ($message, $status) {
if ($status == 'no_update') {
return __('Buzz SEO plugin is up to date.', 'buzz-seo');
} else {
if ($status == 'update_available') {
return __('A new version of the Buzz SEO plugin is available.', 'buzz-seo');
} else {
return sprintf(__('Unknown update checker status `%s`.', 'buzz-seo'), htmlentities($status));
}
}
}, 10, 2);
// Require file since it doesn't have an autoloader
require_once BUZZSEO_DIR . 'vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
$className = \PucFactory::getLatestClassVersion('PucGitHubChecker');
/* @var $updateChecker \PucGitHubChecker_2_2 */
$updateChecker = new $className('https://github.com/nextbuzz/buzz-seo/', BUZZSEO_FILE, 'master');
}
开发者ID:nextbuzz,项目名称:buzz-seo,代码行数:23,代码来源:Admin.php
示例15: strtolower
$class_path = 'class-' . strtolower(str_replace('_', '-', $class_name));
$app_file = LUUP_SRC . DS . 'helper' . DS . $class_path . '.php';
if (file_exists($app_file)) {
require_once $app_file;
}
}
}
/**
* Autoloader
*/
add_action('woocommerce_init', 'init_luup_classes', 0);
function init_luup_classes()
{
spl_autoload_register('WC_LUUP_Autoloader::includes_loader');
spl_autoload_register('WC_LUUP_Autoloader::api_loader');
spl_autoload_register('WC_LUUP_Autoloader::helper_loader');
}
/**
* Add payment gateways
*/
add_filter('woocommerce_payment_gateways', 'add_luup_gateways');
function add_luup_gateways($methods)
{
$methods[] = new WC_LUUP_COPYandPAY();
$methods[] = new WC_LUUP_PayPal();
return $methods;
}
//auto updating
require 'plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = PucFactory::buildUpdateChecker('https://moreniche.com/development/wordpress/updates/woocommerce-luup.json', __FILE__);
开发者ID:LUUP-payments,项目名称:woocommerce-luup,代码行数:30,代码来源:woocommerce-luup.php
示例16: __construct
/**
* Init the plugin
*/
function __construct()
{
// Pagination settings. Not a public setting.
define('WPVQ_QUIZ_PER_PAGE', 25);
// Default Settings
// No i18n outside this function, defines need to be here.
define('WPVQ_PROGRESSBAR_COLOR', "#2bc253");
define('WPVQ_WAIT_TRIVIA_PAGE', 1000);
define('WPVQ_TWITTER_HASHTAG', '#wpquiz');
define('WPVQ_SCROLL_OFFSET', 0);
define('WPVQ_SCROLL_SPEED', 750);
define('WPVQ_SHARE_PERSO_LOCAL', __("I'm %%personality%%", 'wpvq'));
define('WPVQ_SHARE_PERSO_SIMPLE', __("I'm %%personality%%, and you ?", 'wpvq'));
define('WPVQ_SHARE_PERSO_FB_TITLE', __("I'm %%personality%%, and you ?", 'wpvq'));
define('WPVQ_SHARE_PERSO_FB_DESC', "%%details%%");
define('WPVQ_SHARE_TRIVIA_LOCAL', __("I got %%score%% of %%total%% right", 'wpvq'));
define('WPVQ_SHARE_TRIVIA_SIMPLE', __("I got %%score%% of %%total%% right, and you ?", 'wpvq'));
define('WPVQ_SHARE_TRIVIA_FB_TITLE', __("I got %%score%% of %%total%% right, and you ?", 'wpvq'));
define('WPVQ_SHARE_TRIVIA_FB_DESC', "%%details%%");
// Admin Notice for ADDONS PAGE
// Created on WPVQInitController.php
if (!get_option('wpvq_notice_addons_1') == 1) {
add_action('admin_notices', 'wpvq_notice_addons_1');
}
function wpvq_notice_addons_1()
{
?>
<div class="updated wpvq-wpvq_notice_addons_1">
<h3><?php
_e("SOMETHING NEW is happening with WP Viral Quiz !", 'wpvq');
?>
</h3>
<p>
<?php
_e("Discover the <strong>new \"Awesome Addons\" page</strong>, and add new features to your quizzes.", 'wpvq');
?>
</p>
<p>
<a href="<?php
echo admin_url('admin.php?page=wp-viral-quiz-addons');
?>
">
<button class="button button-primary"><?php
_e("Cool, hide this message and show me !", 'wpvq');
?>
</button>
</a>
</p>
</div>
<?php
}
// Update mechanism
$updateChecker = PucFactory::buildUpdateChecker('http://wpvq.institut-pandore.com/update.php', __FILE__, 'wp-viral-quiz', 24);
$updateChecker->addQueryArgFilter(array($this, 'addSecretKeyForUpdate'));
// Admin Menu Page
add_action('admin_menu', array($this, 'options_pages'));
// Install + Uninstall
register_activation_hook(__FILE__, array($this, 'install'));
register_uninstall_hook(__FILE__, array('WPViralQuiz', 'uninstall'));
// Custom script JS
add_action('admin_enqueue_scripts', array($this, 'load_custom_wpviral_script'));
// Create Shortcode
add_shortcode('viralQuiz', array('WPVQShortcode', 'viralQuiz'));
add_shortcode('viralQuizResults', array('WPVQShortcodeResults', 'viralQuizResults'));
add_shortcode('viralQuizAnalytics', array('WPVQShortcodeAnalytics', 'viralQuizAnalytics'));
add_action('init', array('WPVQShortcode', 'register_scripts'));
add_action('wp_footer', array('WPVQShortcode', 'print_scripts'));
add_action('init', array('WPVQShortcodeResults', 'register_scripts'));
add_action('wp_footer', array('WPVQShortcodeResults', 'print_scripts'));
// — Ajax Shortcode
add_action('wp_ajax_choose_truefalse', array('WPVQShortcode', 'chooseTrueFalse'));
add_action('wp_ajax_nopriv_choose_truefalse', array('WPVQShortcode', 'chooseTrueFalse'));
add_action('wp_ajax_get_truefalse_appreciation', array('WPVQShortcode', 'getTrueFalseAppreciation'));
add_action('wp_ajax_nopriv_get_truefalse_appreciation', array('WPVQShortcode', 'getTrueFalseAppreciation'));
add_action('wp_ajax_choose_personality', array('WPVQShortcode', 'choosePersonality'));
add_action('wp_ajax_nopriv_choose_personality', array('WPVQShortcode', 'choosePersonality'));
add_action('wp_ajax_submit_informations', array('WPVQShortcode', 'submitInformations'));
add_action('wp_ajax_nopriv_submit_informations', array('WPVQShortcode', 'submitInformations'));
// - Ajax for quiz import
add_action('wp_ajax_wpvq_import_quiz', array('WPVQGame', 'ajaxImport'));
// - Ajax for Aweber creds
add_action('wp_ajax_wpvq_generate_aweber_creds', array('WPVQMailingAPI', 'generateAweberCreds'));
// i18n support
add_action('plugins_loaded', array($this, 'wpvq_load_textdomain'));
// Image Size for Answer
add_action('after_setup_theme', array($this, 'wpvq_create_thumbnail'));
// Image Size for Answer
add_action('init', array($this, 'wpvq_update_sql'));
// Settings Page
add_action('admin_init', 'wpvq_settings_init');
// Prevent from rocketload / minification
$options = get_option('wpvq_settings');
if (!isset($options['wpvq_checkbox_do_minify'])) {
add_filter('clean_url', array($this, 'rocket_loader_attributes'), 11, 1);
}
// Create new post with quiz shortcode
add_filter('default_content', array($this, 'wpvq_default_editor_content_shortcode'));
//.........这里部分代码省略.........
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:101,代码来源:wp-viral-quiz.php
示例17: var_dump
var_dump($prdctfltr_global);
?>
</div>
<?php
}
function redirect_double_taxonomy($redirect, $request)
{
if (self::$settings['permalink_structure'] !== '' && (is_shop() || is_product_taxonomy()) !== false && strpos($request, 'product_cat=') > 0) {
return $request;
}
return $redirect;
}
function remove_single_redirect()
{
return false;
}
}
add_action('woocommerce_init', array('WC_Prdctfltr', 'init'));
include_once 'lib/pf-characteristics.php';
include_once 'lib/pf-widget.php';
include_once 'lib/pf-shortcode.php';
include_once 'lib/pf-variable-override.php';
if (is_admin()) {
include_once 'lib/pf-settings.php';
//include_once ( 'lib/pf-attribute-thumbnails.php' );
$purchase_code = get_option('wc_settings_prdctfltr_purchase_code', '');
if ($purchase_code) {
require 'lib/update/plugin-update-checker.php';
$pf_check = PucFactory::buildUpdateChecker('http://mihajlovicnenad.com/envato/verify_json.php?k=' . $purchase_code, __FILE__);
}
}
开发者ID:arobbins,项目名称:spellestate,代码行数:31,代码来源:prdctfltr.php
示例18: pgsa_create_posttype
<?php
/*
Plugin Name: Photo Gallery SA
Plugin URI: http://ayarmas:[email protected]
Description: Medical Photo Gallery that groups patients with their related procedures.
Author: Angel Yarmas
Version: 1.0
*/
// Load the auto-update class
require 'plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = PucFactory::buildUpdateChecker('http://ayarmas:[email protected]/update.json', __FILE__);
// Create Photo gallery
function pgsa_create_posttype()
{
// Register custom post type
register_post_type('photo-gallery', array('labels' => array('name' => __('Photo Gallery'), 'singular_name' => __('Photo Gallery'), 'all_items' => __('All Patients'), 'name_admin_bar' => __('Patient'), 'edit_item' => __('Edit Patient'), 'view_item' => __('View Patient')), 'public' => true, 'has_archive' => true, 'menu_icon' => 'dashicons-format-gallery', 'supports' => array('title'), 'hierarchical' => true, 'cptp_permalink_structure' => "/%procedures%/case-%post_id%"));
// Register taxonomy
register_taxonomy('procedures', 'photo-gallery', array('hierarchical' => true, 'labels' => array('name' => __('Procedures'), 'add_new_item' => 'Add a New Procedure'), 'query_var' => true, 'show_admin_column' => true, 'public' => true, 'has_archive' => true, 'show_ui' => true, 'rewrite' => array('slug' => 'photo-gallery')));
}
add_action('init', 'pgsa_create_posttype');
// Remove custom taxonomy base slug in Permalinks
function taxonomy_slug_rewrite($wp_rewrite)
{
$rules = array();
// get all custom taxonomies
$taxonomies = get_taxonomies(array('_builtin' => false), 'objects');
// get all custom post types
$post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects');
foreach ($post_types as $post_type) {
foreach ($taxonomies as $taxonomy) {
开发者ID:angelmoskera,项目名称:sa-photo-gallery,代码行数:31,代码来源:sa-photo-gallery.php
示例19: ciSlidesRegisterMetaBoxes
<?php
/*
Plugin Name: Slides Custom Post Type
Plugin URI: http://conversioninsights.net
Description: Adds a "Slides" post type to be used in the theme.
Version: 2.04
Author: Tyler Young
Author URI: http://conversioninsights.net
*/
require_once 'plugin-updates/plugin-update-checker.php';
require_once 'lib/constants.php';
require_once 'lib/utils.php';
require_once 'lib/createPostType.php';
require_once 'lib/displayPostType.php';
$UpdateChecker = PucFactory::buildUpdateChecker('http://ci-modern-accounting-firm.mystagingwebsite.com/downloads/plugins/slides-cpt_version_metadata.json', __FILE__, 'ci-slides-cpt', 720);
add_filter('rwmb_meta_boxes', 'ciSlidesRegisterMetaBoxes');
function ciSlidesRegisterMetaBoxes($meta_boxes)
{
/**
* Prefix of meta keys (optional)
* Use underscore (_) at the beginning to make keys hidden
* Alt.: You also can make prefix empty to disable it
*/
// Better has an underscore as last sign
$prefix = (defined('CI_THEME_PREFIX') ? CI_THEME_PREFIX : 'ci') . '_';
// Meta box for the slides custom post type
$meta_boxes[] = array('id' => 'slides-only', 'title' => __('Slide options', 'conversion-insights-shared'), 'pages' => array(CI_SLIDE_TYPE), 'context' => 'normal', 'priority' => 'high', 'autosave' => true, 'fields' => array(array('name' => __('Position of caption:', 'conversion-insights-shared'), 'id' => "{$prefix}caption_position", 'type' => 'select', 'options' => array('center' => __('Center', 'conversion-insights-shared'), 'left' => __('Left', 'conversion-insights-shared'), 'right' => __('Right', 'conversion-insights-shared'), 'none' => __('Not displayed', 'conversion-insights-shared')), 'multiple' => false, 'std' => 'center', 'desc' => __('<strong>Note:</strong> On very small screens, all captions will be centered, with a transparent background.', 'conversion-insights-shared')), array('name' => __('Caption background color', 'conversion-insights-shared'), 'id' => "{$prefix}caption_bg", 'type' => 'color', 'desc' => __('<strong>Only</strong> applies to left- or right-positioned captions. Defaults to the secondary background color.', 'conversion-insights-shared')), array('name' => __('Darken slide image?', 'conversion-insights-shared'), 'id' => "{$prefix}darken_slide", 'desc' => __('If checked, image will be darkened 30% (useful for making white text readable over bright images)', 'conversion-insights-shared'), 'type' => 'checkbox', 'std' => 1), array('name' => __('Link slide to this URL:', 'conversion-insights-shared'), 'id' => "{$prefix}link", 'desc' => __('Leave blank for no link.', 'conversion-insights-shared'), 'type' => 'text', 'std' => '', 'clone' => false)));
return $meta_boxes;
}
开发者ID:s3cur3,项目名称:ci-plugins,代码行数:30,代码来源:ci-slides-cpt.php
示例20: init_update_checker
/**
* Load and initialize the plugin update checker.
*
* @since 1.3
*/
public static function init_update_checker()
{
require_once dirname(__FILE__) . '/libraries/plugin-update-checker.php';
self::$plugin_update_checker = PucFactory::buildUpdateChecker('https://tablepress.org/downloads/extensions/update-check/' . self::$slug . '.json', __FILE__);
}
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:10,代码来源:tablepress-responsive-tables.php
注:本文中的PucFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论