本文整理汇总了PHP中content_url函数的典型用法代码示例。如果您正苦于以下问题:PHP content_url函数的具体用法?PHP content_url怎么用?PHP content_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了content_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initGlobalsBase
/**
* init base variables of the globals
*/
public static function initGlobalsBase($pluginFolder)
{
global $wpdb;
GlobalsUG::$isScriptsInFooter = true;
$tablePrefix = $wpdb->prefix;
GlobalsUG::$table_galleries = $tablePrefix . GlobalsUG::TABLE_GALLERIES_NAME;
GlobalsUG::$table_categories = $tablePrefix . GlobalsUG::TABLE_CATEGORIES_NAME;
GlobalsUG::$table_items = $tablePrefix . GlobalsUG::TABLE_ITEMS_NAME;
$pluginName = "unitegallery";
GlobalsUG::$pathPlugin = realpath($pluginFolder) . "/";
GlobalsUG::$path_media_ug = GlobalsUG::$pathPlugin . "unitegallery-plugin/";
GlobalsUG::$path_base = ABSPATH;
$arrUploadDir = wp_upload_dir();
$pathImages = $arrUploadDir["basedir"];
GlobalsUG::$path_images = realpath($pathImages) . "/";
GlobalsUG::$path_cache = GlobalsUG::$pathPlugin . "cache/";
GlobalsUG::$urlPlugin = plugin_dir_url($pluginFolder . "/unitegallery.php");
GlobalsUG::$url_component_client = "";
GlobalsUG::$url_component_admin = admin_url() . "admin.php?page={$pluginName}";
GlobalsUG::$url_base = site_url() . "/";
GlobalsUG::$url_media_ug = GlobalsUG::$urlPlugin . "unitegallery-plugin/";
GlobalsUG::$url_images = content_url() . "/";
GlobalsUG::$url_ajax = admin_url() . "/admin-ajax.php";
GlobalsUG::$url_ajax_front = GlobalsUG::$url_ajax;
}
示例2: register
public function register()
{
$local_test = false;
$fpd_css_url = $local_test ? 'http://radykal.dev/fpd3/css/jquery.fancyProductDesigner.css' : plugins_url('/css/jquery.fancyProductDesigner.min.css', FPD_PLUGIN_ROOT_PHP);
$fpd_js_url = $local_test ? 'http://radykal.dev/fpd3/js/jquery.fancyProductDesigner.js' : plugins_url('/js/jquery.fancyProductDesigner.min.js', FPD_PLUGIN_ROOT_PHP);
$fpd_js_url = get_option('fpd_debug_mode') == 'yes' ? plugins_url('/js/jquery.fancyProductDesigner.js', FPD_PLUGIN_ROOT_PHP) : $fpd_js_url;
//register css files
wp_register_style('fpd-icon-font', plugins_url('/css/icon-font.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
$fonts_dir = WP_CONTENT_DIR . '/uploads/fpd_fonts';
$fonts_css = $fonts_dir . '/jquery.fancyProductDesigner-fonts.css';
if (!file_exists($fonts_css)) {
if (!file_exists($fonts_dir)) {
wp_mkdir_p($fonts_dir);
}
$handle = @fopen($fonts_css, 'w') or print 'Cannot open file: ' . $fonts_css;
fclose($handle);
}
wp_register_style('fpd-fonts', content_url('/uploads/fpd_fonts/jquery.fancyProductDesigner-fonts.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
wp_register_style('fpd-plugins', plugins_url('/css/plugins.min.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
wp_register_style('fpd-jquery-ui', plugins_url('/css/jquery-ui.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
wp_register_style('jquery-fpd', $fpd_css_url, array('fpd-fonts', 'fpd-jquery-ui'), Fancy_Product_Designer::FPD_VERSION);
wp_enqueue_style('font-awesome-4', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', false, '4.3.0');
wp_register_style('fpd-jssocials-theme', plugins_url('/assets/jssocials/jssocials-theme-flat.css', FPD_PLUGIN_ROOT_PHP), false, '0.2.0');
wp_register_style('fpd-jssocials', plugins_url('/assets/jssocials/jssocials.css', FPD_PLUGIN_ROOT_PHP), array('font-awesome-4', 'fpd-jssocials-theme'), '0.2.0');
wp_register_script('fpd-jssocials', plugins_url('/assets/jssocials/jssocials.min.js', FPD_PLUGIN_ROOT_PHP), false, '0.2.0');
//register js files
wp_register_script('fpd-plugins', plugins_url('/js/plugins.js', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
wp_register_script('fabric', plugins_url('/js/fabric.js', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
wp_register_script('fpd-jquery-form', plugins_url('/js/jquery.form.min.js', FPD_PLUGIN_ROOT_PHP));
$fpd_dep = array('jquery', 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-sortable', 'jquery-ui-slider', 'fabric');
if (get_option('fpd_debug_mode') == 'yes' || $local_test) {
array_push($fpd_dep, 'fpd-plugins');
}
wp_register_script('jquery-fpd', $fpd_js_url, $fpd_dep, Fancy_Product_Designer::FPD_VERSION);
}
示例3: Init
function Init()
{
// We reach here for main site blog admin AND network admin, even if multisite enabled
// This is because in multisite there is no network admin AJAX, so we need to utilise the admin AJAX
// So if we're is_admin and not network admin (or not multisite), do the AJAX, and then quit if we're multisite (since we only want to show stuff in network_admin)
if (is_admin() && (!$this->WPOnlineBackup->multisite || !is_network_admin())) {
// Register AJAX action for dynamic manual backup.
add_action('wp_ajax_wponlinebackup_progress', array(&$this, 'AJAX_Progress'));
add_action('wp_ajax_wponlinebackup_kick_start', array(&$this, 'AJAX_Kick_Start'));
// If we're multisite, we're done!
if ($this->WPOnlineBackup->multisite) {
return;
}
}
// Only load if we have permission
if (!$this->WPOnlineBackup->multisite && current_user_can('install_plugins') || $this->WPOnlineBackup->multisite && current_user_can('manage_sites')) {
// Define WPONLINEBACKUP_URL using plugin_dir_url - we have to do this here because plugin_dir_url uses filters and therefore we need to wait for wordpress to load before using it
define('WPONLINEBACKUP_URL', preg_replace('#/$#', '', plugin_dir_url(WPONLINEBACKUP_FILEPATH)));
// BTL code styling requires we do not have forward slash!
define('WPONLINEBACKUP_LOCALBACKUPURL', content_url() . '/backups');
// Plugin links...
add_filter(($this->WPOnlineBackup->multisite ? 'network_admin_' : '') . 'plugin_action_links_' . WPONLINEBACKUP_FILE, array(&$this, 'Plugin_Actions'));
// Queue CSS we use for our menu item
add_action('admin_head', array(&$this, 'Admin_Menu_Head'));
// Adding the navigation entries...
add_action(($this->WPOnlineBackup->multisite ? 'network_admin_' : 'admin_') . 'menu', array(&$this, 'Admin_Menu'));
// Grab formatting functions
require_once WPONLINEBACKUP_PATH . '/include/formatting.php';
$this->WPOnlineBackup->Load_Language();
}
}
示例4: micro_themes_dir_best_guess
function micro_themes_dir_best_guess()
{
$wp_content_dir = str_replace(site_url(), ABSPATH, content_url());
// if it still has http, use fallback dir method
if (strpos($wp_content_dir, 'http') !== false) {
$wp_content_dir = WP_CONTENT_DIR;
}
// now for the micro-themes dir
$micro_root_dir = $wp_content_dir . '/micro-themes/';
// exception for multisite
global $wp_version;
global $blog_id;
if ($wp_version >= 3 and is_multisite()) {
$filename = $wp_content_dir . "/blogs.dir/";
if (file_exists($filename)) {
if ($blog_id == '1') {
$micro_root_dir = $wp_content_dir . '/blogs.dir/micro-themes/';
} else {
$micro_root_dir = $wp_content_dir . '/blogs.dir/' . $blog_id . '/micro-themes/';
}
} else {
if ($blog_id == '1') {
$micro_root_dir = $wp_content_dir . '/uploads/sites/micro-themes/';
} else {
$micro_root_dir = $wp_content_dir . '/uploads/sites/' . $blog_id . '/micro-themes/';
}
}
}
return $micro_root_dir;
}
示例5: getFeedData
function getFeedData($category, $remote_category, $file_name, $saved_feed = null)
{
$this->logActivity('Initializing...');
global $message;
global $pfcore;
$providers = new PProviderList();
$this->logActivity('Loading paths...');
if (!$this->checkFolders()) {
return;
}
$file_url = PFeedFolder::uploadFolder() . $this->providerName . '/' . $file_name . '.' . $this->fileformat;
$file_path = PFeedFolder::uploadURL() . $this->providerName . '/' . $file_name . '.' . $this->fileformat;
//Special (WordPress): where admin is https and site is http, path to wp-uploads works out incorrectly as https
// we check the content_url() for https... if not present, patch the file_path
if ($pfcore->cmsName == 'WordPress' && strpos($file_path, 'https://') !== false && strpos(content_url(), 'https') === false) {
$file_path = str_replace('https://', 'http://', $file_path);
}
//Create the Feed
$this->logActivity('Creating feed data');
$this->filename = $file_url;
$this->productCount = 0;
$content = 'Place-Holder File, This file will be replaced next refresh, To manually fill this data, go to manage feeds and click [Update Now]';
file_put_contents($this->filename, $content);
$this->logActivity('Updating Feed List');
PFeedActivityLog::updateFeedList($category, $remote_category, $file_name, $file_path, $this->providerName, $this->productCount);
//Save the feedlist
$id = PFeedActivityLog::feedDataToID($file_name, $this->providerName);
$pfcore->settingSet('cpf_aggrfeedlist_' . $id, implode(',', $this->feed_list));
if ($this->productCount == 0) {
//$this->message .= '<br>No products returned';
//return;
}
$this->success = true;
}
示例6: guessPath
/**
* Guess absolute path from file URL
*
* @param string $file_url File's url
* @return string
*/
public function guessPath($file_url)
{
$components = parse_url($file_url);
// Check we have at least a path
if (!isset($components['path'])) {
return false;
}
$file_path = false;
$wp_plugin_url = plugins_url();
$wp_content_url = content_url();
// Script is enqueued from a plugin
$url_regex = $this->getUrlRegex($wp_plugin_url);
if (preg_match($url_regex, $file_url) > 0) {
$file_path = WP_PLUGIN_DIR . preg_replace($url_regex, '', $file_url);
}
// Script is enqueued from a theme
$url_regex = $this->getUrlRegex($wp_content_url);
if (preg_match($url_regex, $file_url) > 0) {
$file_path = WP_CONTENT_DIR . preg_replace($url_regex, '', $file_url);
}
// Script is enqueued from wordpress
if (strpos($file_url, WPINC) !== false) {
$file_path = untrailingslashit(ABSPATH) . $file_url;
}
return $file_path;
}
示例7: qtranxf_loadfiles_js
/**
* Read or enqueue Java script files listed in $jss.
* @since 3.3.2
*/
function qtranxf_loadfiles_js($jss, $enqueue_script)
{
$cnt = 0;
$deps = array();
foreach ($jss as $k => $js) {
if (isset($js['javascript']) && !empty($js['javascript'])) {
echo $js['javascript'];
} else {
if (isset($js['src'])) {
$src = $js['src'];
if ($enqueue_script) {
$handle = isset($js['handle']) ? $js['handle'] : (is_string($k) ? $k : 'qtranslate-admin-js-' . ++$cnt);
$ver = isset($js['ver']) ? $js['ver'] : QTX_VERSION;
$url = content_url($src);
wp_register_script($handle, $url, $deps, $ver, true);
wp_enqueue_script($handle);
$deps[] = $handle;
} else {
$fp = WP_CONTENT_DIR . '/' . $src;
readfile($fp);
}
}
}
}
}
示例8: seller_profile
function seller_profile($atts)
{
global $wpdb;
$obj_mp20 = new MP_Form_Handler();
$obj_mp20->profile_edit_redirection();
$current_user = wp_get_current_user();
$table_users = $wpdb->prefix . "users";
$table_seller = $wpdb->prefix . "mpsellerinfo";
$myrows = $wpdb->get_results("SELECT u.*,s.* FROM " . $table_users . " u join " . $table_seller . " s on s.user_id=u.ID where u.ID='{$current_user->ID}'");
$user_rows = $wpdb->get_results("select um.meta_key,um.meta_value from {$wpdb->usermeta} um where um.user_id='{$current_user->ID}'");
$user_meta = array();
foreach ($user_rows as $value) {
$user_meta[$value->meta_key] = $value->meta_value;
}
$avatar = $obj_mp20->get_user_avatar($current_user->ID, 'avatar');
echo '<section id="contentForm">';
echo '<form method="post"><h1>Profile</h1>';
echo '<div><img src="' . content_url() . '/uploads/' . $avatar[0]->meta_value . '" width="50" height="50"></div> <br />';
echo '<div>Username: ' . $current_user->user_login . '</div><br />';
echo '<div>User email: ' . $current_user->user_email . '</div><br />';
echo '<div>User first name: ' . $current_user->user_firstname . '</div><br />';
echo '<div>User last name: ' . $current_user->user_lastname . '</div><br />';
echo '<div>User display name: ' . $current_user->display_name . '</div><br />';
echo '<div><a class="button" href="' . get_permalink() . '?page=pedit" title="Edit Profile">Edit</a> <a class="button" href="' . wp_logout_url() . '" title="Logout">Logout</a><br /></div></form>';
echo '</section>';
}
示例9: getBaseUrl
public function getBaseUrl()
{
$dirFromFile = dirname(dirname(__FILE__));
$dirFromFile = str_replace('\\', '/', $dirFromFile);
$pos = strpos($dirFromFile, 'wp-content') + strlen('wp-content');
return content_url() . '/' . substr($dirFromFile, $pos);
}
示例10: init
public static function init()
{
global $wp_filesystem;
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
// Create our private upload directory
Redux_Functions::initWpFilesystem();
self::$_upload_dir = trailingslashit($wp_filesystem->wp_content_dir()) . '/redux/';
self::$_upload_url = trailingslashit(content_url()) . '/redux/';
if (function_exists('sys_get_temp_dir')) {
$tmp = sys_get_temp_dir();
if (empty($tmp)) {
$tmpDir = self::$_upload_url . 'tmp';
if (file_exists($tmpDir)) {
Redux_Helpers::rmdir($tmpDir);
}
putenv('TMPDIR=' . self::$_upload_dir . 'tmp');
}
}
// Ensure it exists
if (!is_dir(self::$_upload_dir)) {
// Create the directory
$wp_filesystem->mkdir(self::$_upload_dir);
}
}
示例11: get_theme_root_uri
function get_theme_root_uri($stylesheet_or_template = false, $theme_root = false)
{
if ($stylesheet_or_template && !$theme_root) {
$theme_root = get_raw_theme_root($stylesheet_or_template);
}
if ($stylesheet_or_template && $theme_root) {
if (in_array($theme_root, (array) $wp_theme_directories)) {
// Absolute path. Make an educated guess. YMMV -- but note the filter below.
if (0 === strpos($theme_root, WP_CONTENT_DIR)) {
$theme_root_uri = content_url(str_replace(WP_CONTENT_DIR, '', $theme_root));
} elseif (0 === strpos($theme_root, ABSPATH)) {
$theme_root_uri = site_url(str_replace(ABSPATH, '', $theme_root));
} elseif (0 === strpos($theme_root, WP_PLUGIN_DIR) || 0 === strpos($theme_root, WPMU_PLUGIN_DIR)) {
$theme_root_uri = plugins_url(basename($theme_root), $theme_root);
} else {
$theme_root_uri = $theme_root;
}
} else {
$theme_root_uri = content_url($theme_root);
}
} else {
$theme_root_uri = content_url();
}
return apply_filters('theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template);
}
示例12: __construct
/**
* Instantiates Env Manager object
*
*/
protected function __construct()
{
$uploads_data = wp_upload_dir();
$template_url = get_bloginfo('template_url');
// Instantiate paths collection object
$this->__urls = new Collection(array('home' => home_url(), 'admin' => admin_url(), 'plugins' => plugins_url(), 'content' => content_url(), 'uploads' => $uploads_data['baseurl'], 'themes' => str_replace('/' . basename($template_url), '', $template_url), 'theme' => $template_url));
}
示例13: bluerockre_slider_scripts
function bluerockre_slider_scripts()
{
if (is_singular('portfolio')) {
wp_enqueue_script('slider', content_url() . '/plugins/bluerock-portfolio/slider/js/lightslider.js', false, 1.0, false);
wp_enqueue_style('slider', content_url() . '/plugins/bluerock-portfolio/slider/css/lightslider.css');
}
}
示例14: constants
private function constants()
{
# Dirs
define('THESIS_LIB', TEMPLATEPATH . '/lib');
define('THESIS_ADMIN', THESIS_LIB . '/admin');
define('THESIS_CORE', THESIS_LIB . '/core');
define('THESIS_JS', THESIS_LIB . '/js');
define('THESIS_SKINS', THESIS_LIB . '/skins');
# URLs
define('THESIS_URL', get_bloginfo('template_url'));
#wp
define('THESIS_CSS_URL', THESIS_URL . '/lib/css');
define('THESIS_JS_URL', THESIS_URL . '/lib/js');
define('THESIS_IMAGES_URL', THESIS_URL . '/lib/images');
# User dirs
define('THESIS_USER', WP_CONTENT_DIR . '/thesis');
define('THESIS_USER_SKINS', THESIS_USER . '/skins');
define('THESIS_USER_BOXES', THESIS_USER . '/boxes');
define('THESIS_USER_PACKAGES', THESIS_USER . '/packages');
# User URLs
define('THESIS_USER_URL', content_url('thesis'));
define('THESIS_USER_SKINS_URL', THESIS_USER_URL . '/skins');
define('THESIS_USER_BOXES_URL', THESIS_USER_URL . '/boxes');
define('THESIS_USER_PACKAGES_URL', THESIS_USER_URL . '/packages');
if (is_multisite()) {
define('THESIS_MS_CSS_VAL', substr(str_rot13(md5("ms-css_{$GLOBALS['blog_id']}")), 0, 5));
}
}
示例15: export
function export()
{
global $wpdb;
$px_table_name = $wpdb->prefix . 'gcm_users';
$query = "SELECT * FROM {$px_table_name}";
$datas = $wpdb->get_results($query);
$url = wp_nonce_url('admin.php?page=px-gcm-export', 'px-gcm-export');
if (false === ($creds = request_filesystem_credentials($url, '', false, false, null))) {
return true;
}
if (!WP_Filesystem($creds)) {
// our credentials were not good, ask the user for them again
request_filesystem_credentials($url, '', true, false, null);
return true;
}
global $wp_filesystem;
$contentdir = trailingslashit($wp_filesystem->wp_content_dir());
$in = "Databse ID;GCM Registration ID;Device OS;Device Model;Created At;Messages sent to this Device;\n";
foreach ($datas as $data) {
$in .= $data->id . ";" . $data->gcm_regid . ";" . $data->os . ";" . $data->model . ";" . $data->created_at . ";" . $data->send_msg . "\n";
}
mb_convert_encoding($in, "ISO-8859-1", "UTF-8");
if (!$wp_filesystem->put_contents($contentdir . 'GCM-Export.csv', $in, FS_CHMOD_FILE)) {
echo 'Failed saving file';
}
return content_url() . "/GCM-Export.csv";
}