本文整理汇总了PHP中plugin_dir_url函数的典型用法代码示例。如果您正苦于以下问题:PHP plugin_dir_url函数的具体用法?PHP plugin_dir_url怎么用?PHP plugin_dir_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plugin_dir_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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();
}
开发者ID:webremote,项目名称:anthologize,代码行数:38,代码来源:anthologize.php
示例2: cherry_plugin_settings
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');
}
开发者ID:drupalninja,项目名称:schome_org,代码行数:29,代码来源:cherry-plugin.php
示例3: __construct
public function __construct()
{
$plugin_dir = plugin_dir_url(__FILE__);
global $woocommerce;
$this->id = 'twocheckoutpp';
$this->icon = apply_filters('woocommerce_twocheckoutpp_icon', '' . $plugin_dir . 'paypal.png');
$this->has_fields = true;
// Load the settings
$this->init_form_fields();
$this->init_settings();
// Define user set variables
$this->title = $this->get_option('title');
$this->seller_id = $this->get_option('seller_id');
$this->secret_word = $this->get_option('secret_word');
$this->description = $this->get_option('description');
$this->notify_url = str_replace('https:', 'http:', add_query_arg('wc-api', 'WC_Gateway_Twocheckoutpp', home_url('/')));
$this->debug = $this->get_option('debug');
self::$log_enabled = $this->debug;
// Actions
add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page'));
// Save options
add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
// Payment listener/API hook
add_action('woocommerce_api_wc_gateway_twocheckoutpp', array($this, 'check_ipn_response'));
if (!$this->is_valid_for_use()) {
$this->enabled = false;
}
}
开发者ID:narendra-addweb,项目名称:MyImmoPix,代码行数:28,代码来源:wc-twocheckoutpp.php
示例4: __construct
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/');
}
开发者ID:juslee,项目名称:e27,代码行数:34,代码来源:premise.php
示例5: owl_carousel_admin_register_scripts
/**
* List of JavaScript / CSS files for admin
*/
function owl_carousel_admin_register_scripts()
{
wp_register_style('owl.carousel.admin.styles', plugin_dir_url(__FILE__) . 'css/admin_styles.css');
wp_enqueue_style('owl.carousel.admin.styles');
wp_register_script('owl.carousel.admin.script', plugin_dir_url(__FILE__) . 'js/admin_script.js');
wp_enqueue_script('owl.carousel.admin.script');
}
开发者ID:em222iv,项目名称:eerie,代码行数:10,代码来源:owlcarousel.php
示例6: pmproet_scripts
function pmproet_scripts()
{
if (!empty($_REQUEST['page']) && $_REQUEST['page'] == 'pmpro-email-templates') {
wp_enqueue_script('pmproet', plugin_dir_url(__FILE__) . 'js/pmproet.js', array('jquery'), null, false);
wp_enqueue_style('pmproet', plugin_dir_url(__FILE__) . 'css/pmproet.css');
}
}
开发者ID:audiblePi,项目名称:fccTest,代码行数:7,代码来源:pmpro-email-templates.php
示例7: cf_slack_register_processor
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;
}
开发者ID:conscious-jp,项目名称:website,代码行数:7,代码来源:cf-slack.php
示例8: enqueue_scripts
/**
* Register the stylesheets for the public-facing side of the site.
*
* @since 1.0.0
*/
public function enqueue_scripts()
{
/**
*
*/
wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wvas-public.js', array('jquery'), $this->version, false);
}
开发者ID:binq2,项目名称:borealpaddle,代码行数:12,代码来源:class-wvas-public.php
示例9: enqueue_frontend_scripts
function enqueue_frontend_scripts($instance)
{
if (!empty($instance['trigger'])) {
wp_enqueue_script('waypoints', plugin_dir_url(LRW_BASE_FILE) . 'inc/assets/js/waypoints.min.js', array('jquery'), LRW_BUNDLE_VERSION);
}
parent::enqueue_frontend_scripts($instance);
}
开发者ID:luizrw,项目名称:lrw-so-widgets-bundle,代码行数:7,代码来源:lrw-progress-bar-vert.php
示例10: initialize
function initialize()
{
$this->register_frontend_scripts(array(array('lsow-ytp', LSOW_PLUGIN_URL . 'assets/js/jquery.mb.YTPlayer' . SOW_BUNDLE_JS_SUFFIX . '.js', array('jquery'), LSOW_VERSION)));
$this->register_frontend_styles(array(array('lsow-hero-image', plugin_dir_url(__FILE__) . 'css/style.css')));
add_action('wp_enqueue_scripts', array($this, 'init_custom_css'), 15);
// load as late as possible
}
开发者ID:ErhanLammar,项目名称:all-construct.be,代码行数:7,代码来源:lsow-hero-image-widget.php
示例11: enqueue_scripts
/**
* Register the stylesheets for the public-facing side of the site.
*
* @since 1.0.0
*/
public function enqueue_scripts()
{
wp_enqueue_script($this->plugin_name . "_jquery_cookie", plugin_dir_url(__FILE__) . 'js/vendor/jquery.cookie.js', array('jquery'), $this->version, false);
wp_register_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/smarter-browser-warning-public.js', array('jquery'), $this->version, false);
wp_localize_script($this->plugin_name, 'sbw_globals', $this->get_js_globals());
wp_enqueue_script($this->plugin_name);
}
开发者ID:bokorir,项目名称:smarter-browser-warning,代码行数:12,代码来源:class-smarter-browser-warning-public.php
示例12: get_plugin_url
public function get_plugin_url()
{
if ($this->plugin_url) {
return $this->plugin_url;
}
return $this->plugin_url = plugin_dir_url(__FILE__);
}
开发者ID:jaredkc,项目名称:wc-variations-radio-buttons,代码行数:7,代码来源:wc-variations-radio-buttons.php
示例13: myplugin_scripts
function myplugin_scripts()
{
wp_register_style('jQuery-UI-style', plugin_dir_url(__FILE__) . 'css/jquery-ui-black-tie.css');
wp_enqueue_style('jQuery-UI-style');
wp_register_style('MB-style', plugin_dir_url(__FILE__) . 'css/style.css');
wp_enqueue_style('MB-style');
}
开发者ID:Addono,项目名称:MicroBalance,代码行数:7,代码来源:MicroBalance.php
示例14: set_url
/**
* Properly set the Kirki URL for assets.
* Determines if Kirki is installed as a plugin, in a child theme, or a parent theme
* and then does some calculations to get the proper URL for its CSS & JS assets.
*/
public function set_url()
{
// The path of the Kirki's parent-folder.
$path = wp_normalize_path(dirname(Kirki::$path));
// Get parent-theme path.
$parent_theme_path = get_template_directory();
$parent_theme_path = wp_normalize_path($parent_theme_path);
// Get child-theme path.
$child_theme_path = get_stylesheet_directory_uri();
$child_theme_path = wp_normalize_path($child_theme_path);
Kirki::$url = plugin_dir_url(dirname(__FILE__) . 'kirki.php');
// Is Kirki included in a parent theme?
if (false !== strpos(Kirki::$path, $parent_theme_path)) {
Kirki::$url = get_template_directory_uri() . str_replace($parent_theme_path, '', Kirki::$path);
}
// Is there a child-theme?
if ($child_theme_path !== $parent_theme_path) {
// Is Kirki included in a child theme?
if (false !== strpos(Kirki::$path, $child_theme_path)) {
Kirki::$url = get_template_directory_uri() . str_replace($child_theme_path, '', Kirki::$path);
}
}
// Apply the kirki/config filter.
$config = apply_filters('kirki/config', array());
if (isset($config['url_path'])) {
Kirki::$url = esc_url_raw($config['url_path']);
}
}
开发者ID:aristath,项目名称:kirki,代码行数:33,代码来源:class-kirki-init.php
示例15: input_admin_enqueue_scripts
function input_admin_enqueue_scripts()
{
$dir = plugin_dir_url(__FILE__);
// register & include JS
wp_register_script('acf-input-twoway', "{$dir}2way.js");
wp_enqueue_script('acf-input-twoway');
}
开发者ID:62design,项目名称:acf-2way-pr,代码行数:7,代码来源:acf-2way-pr-v5.php
示例16: __construct
public function __construct()
{
global $wpdb;
$this->_fwork = 'plulz';
$this->_share = get_option($this->_fwork);
$this->_shareList = array('Brindes', 'Brindes Personalizados');
$this->group = 'facebook_group';
$this->name = 'fbseocomments';
$this->table = $wpdb->prefix . 'comments_fbseo';
$this->pluginAdminPage = admin_url('admin.php') . '?page=' . $this->name;
$this->action = admin_url('options.php');
$this->options = get_option($this->name);
$this->wordpressLink = 'seo-facebook-comments';
$this->adminStylesheet = array('filedir' => PLULZ_SEOFB_PLUGIN_ASSETS, 'name' => $this->name . 'Stylesheet');
$this->menuPage = array('page_title' => 'SEO Facebook Comments', 'menu_title' => 'SEO Facebook', 'capability' => 'administrator', 'menu_slug' => $this->name, 'icon_url' => plugin_dir_url(__FILE__) . 'assets/tiny-logo-plulz.png', 'position' => '', 'submenus' => array());
// @ref http://codex.wordpress.org/Function_Reference/add_action
add_action('wp_print_styles', array(&$this, 'addFbStyles'));
// og tags
add_action('wp_head', array(&$this, 'fbOpenGraph'));
// og tag
// fbLanguages
add_action('language_attributes', array(&$this, 'fbLanguages'));
// comments
add_filter('comments_array', array(&$this, 'FbComments'));
// share
add_action('wp_footer', array(&$this, 'share'));
register_activation_hook(__FILE__, array(&$this, 'install'));
register_deactivation_hook(__FILE__, array(&$this, 'remove'));
register_uninstall_hook(__FILE__, array(&$this, 'remove'));
parent::__construct();
}
开发者ID:vsalx,项目名称:rattieinfo,代码行数:31,代码来源:seofacebook.php
示例17: __construct
function __construct($wpdb, $wp_plugin_dir, $downloader)
{
$this->db = $wpdb;
$this->plugin_path = $wp_plugin_dir;
$this->plugin_url = plugin_dir_url(__FILE__);
$this->downloader = $downloader;
}
开发者ID:boliev,项目名称:hh_resume,代码行数:7,代码来源:Resume.php
示例18: r_bopenlearn_menu
function r_bopenlearn_menu()
{
add_menu_page('B Open Learn', 'B Open Learn', 'manage_options', __FILE__, 'r_bopenlearn_overview', plugin_dir_url(__FILE__) . '/images/icon.png');
add_submenu_page(__FILE__, 'Subject Suggestion', 'Subject Suggestion', 'manage_options', __FILE__ . '_suggestion', 'r_bopenlearn');
add_submenu_page(__FILE__, 'New Post Suggestion', 'New Post Suggestion', 'manage_options', __FILE__ . '_newpost', 'r_newpost');
add_submenu_page(__FILE__, 'Course Tracker', 'Course Tracker', 'manage_options', __FILE__ . '_ctrack', 'r_ctrack');
}
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:7,代码来源:openlearn.php
示例19: enqueue
public function enqueue()
{
wp_enqueue_script('advanced_css_editor_codemirror_js', plugin_dir_url(__FILE__) . 'js/codemirror.js', array('jquery'), '', true);
wp_enqueue_script('advanced_css_editor_css_js', plugin_dir_url(__FILE__) . 'js/css.js', array('advanced_css_editor_codemirror_js'), '', true);
wp_enqueue_script('advanced_css_editor_custom_js', plugin_dir_url(__FILE__) . 'js/code-control.js', array('advanced_css_editor_codemirror_js'), '', true);
wp_enqueue_style('advanced_css_editor_codemirror_css', plugin_dir_url(__FILE__) . 'css/codemirror.css', NULL, NULL, 'all');
}
开发者ID:HardeepAsrani,项目名称:advanced-css-editor,代码行数:7,代码来源:syntax-highlighter.php
示例20: boot
/**
* Boots the Helper.
*/
public static function boot()
{
self::$base = plugin_directory();
self::$base = self::$base . '/' . basename(plugin_dir_url(__DIR__)) . '/';
self::$config = @(require self::$base . '/herbert.config.php');
self::$booted = true;
}
开发者ID:shortlist-digital,项目名称:agreable-poll-plugin,代码行数:10,代码来源:Helper.php
注:本文中的plugin_dir_url函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论