本文整理汇总了PHP中includes_url函数的典型用法代码示例。如果您正苦于以下问题:PHP includes_url函数的具体用法?PHP includes_url怎么用?PHP includes_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了includes_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ac_gallery_get_upload_meta_data
function ac_gallery_get_upload_meta_data()
{
$plupload_init = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'plupload-browse-button', 'container' => 'plupload-upload-ui', 'drop_element' => 'drag-drop-area', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files', 'alleycat'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multipart_params' => array('_ajax_nonce' => wp_create_nonce('photo-upload'), 'action' => 'photo_gallery_upload'));
// Get the data values
$plupload_init = apply_filters('plupload_init', $plupload_init);
return $plupload_init;
}
示例2: initStyleScript
/**
* Load JS and CSS need for admin features.
*
*/
function initStyleScript($hook_sufix)
{
global $taxonomy;
if ($hook_sufix == 'edit-tags.php') {
if ($taxonomy != $this->taxo->name) {
return false;
}
foreach ($this->sidebars_fields as $name => $sidebar) {
if ($name == 'cf_inactive_fields' || empty($sidebar) || !is_array($sidebar)) {
continue;
}
foreach ($sidebar as $widget) {
$idbase = $this->cf_registered_fields[$widget]['classname'];
// Allow composant to add JS/CSS
do_action('cf-fields-scriptstyles-' . $idbase);
}
}
$this->_editTags = true;
// Add CSS for boxes
wp_enqueue_style('simple-custom-types-object', SCF_URL . '/inc/css/admin.css', array(), SCF_VERSION);
wp_enqueue_script("tiny_mce", includes_url('js/tinymce') . '/tiny_mce.js');
return true;
}
return false;
}
示例3: html5press_register_scripts
function html5press_register_scripts()
{
/**
* Modernizr enables HTML5 elements & feature detects
* For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
*/
wp_enqueue_script('modernizr', get_stylesheet_directory_uri() . '/js/modernizr-2.0.6.min.js', '', '2.0.6');
// Make sure jQuery is loaded after Modernizr
wp_deregister_script('jquery');
wp_enqueue_script('jquery', includes_url('js/jquery/jquery.js'), array('modernizr'), null);
wp_enqueue_script('easing', get_stylesheet_directory_uri() . '/js/easing.min.js', array('jquery'), '1.1.2', true);
global $html5press_options;
$html5press_settings = get_option('html5press_options', $html5press_options);
// If back to top is enabled, add easing and the back to top javascript.
if ($html5press_settings['back_to_top'] == 1) {
wp_enqueue_script('totop', get_stylesheet_directory_uri() . '/js/jquery.ui.totop.js', array('jquery'), '1.1', true);
}
if ($html5press_settings['enable_slimbox'] == 1) {
wp_enqueue_script('slimbox2', get_stylesheet_directory_uri() . '/js/slimbox2.js', array('jquery'), '2.04', true);
}
if (!empty($html5press_settings['featured_cat'])) {
wp_enqueue_script('bxslider', get_stylesheet_directory_uri() . '/js/jquery.bxSlider.min.js', array('jquery'), '3.0', true);
wp_enqueue_script('bxslider-load', get_stylesheet_directory_uri() . '/js/bxslider-load.js', array('bxslider'), '1.0', true);
}
if ($html5press_settings['fuzzy_timestamps'] == 1) {
wp_enqueue_script('timeago', get_stylesheet_directory_uri() . '/js/jquery.timeago.js', array('jquery'), '0.9.3', true);
}
}
示例4: to_json
/**
* Returns an array that holds the field data, suitable for JSON representation.
* This data will be available in the Underscore template and the Backbone Model.
*
* @param bool $load Should the value be loaded from the database or use the value from the current instance.
* @return array
*/
public function to_json($load)
{
$field_data = parent::to_json($load);
$url = '';
$thumb_url = '';
$default_thumb_url = includes_url('/images/media/default.png');
$file_ext = '';
$file_type = '';
$value = $this->get_value();
if ($value) {
$url = is_numeric($value) ? wp_get_attachment_url($value) : $value;
$filetype = wp_check_filetype($url);
$file_ext = $filetype['ext'];
// png, mp3, etc..
$file_type = preg_replace('~\\/.+$~', '', $filetype['type']);
// image, video, etc..
if ($file_type == 'image') {
$thumb_url = $url;
if ($this->value_type == 'id') {
$thumb_src = wp_get_attachment_image_src($value, 'thumbnail');
$thumb_url = $thumb_src[0];
}
} else {
$thumb_url = $default_thumb_url;
}
}
$field_data = array_merge($field_data, array('url' => (string) $url, 'thumb_url' => $thumb_url, 'default_thumb_url' => $default_thumb_url, 'file_ext' => $file_ext, 'file_type' => $file_type, 'button_label' => $this->button_label, 'window_button_label' => $this->window_button_label, 'window_label' => $this->window_label, 'type_filter' => $this->field_type, 'value_type' => $this->value_type));
return $field_data;
}
示例5: amr_ical_support_links
function amr_ical_support_links()
{
echo '<div class="postbox" style="padding:1em 2em; width: 600px;">
<p>
<a href="http://icalevents.com/documentation" title="documentation for amr-ical-events-list and amr-events">';
_e('Documentation', 'amr-ical-events-list');
echo '</a>
<a href="http://icalevents.com/support/" title="Support Forum">';
_e('Support', 'amr-ical-events-list');
/* echo '</a>
<a href="http://icalevents.com/videos" title="Events plugin videos">';
_e('Videos', 'amr-ical-events-list');
*/
echo '</a>
<a href="https://wordpress.org/support/plugin/amr-ical-events-list" title="If you like it rate it...">';
_e('Rate or Review', 'amr-ical-events-list');
echo '</a> <a href="http://icalevents.com/feed/">';
_e('Plugin feed', 'amr-ical-events-list');
echo '</a> <img src="';
echo includes_url();
echo 'images/rss.png" alt="Rss icon" style="vertical-align:middle;" />';
/*echo '
<a href="http://icalevents.com/forums/feed">';
_e('Forum feed', 'amr-ical-events-list');
echo '</a> <img src="';
echo includes_url();
echo 'images/rss.png" alt="Rss icon" style="vertical-align:middle;" />';*/
echo '</p>';
echo '</div>';
}
示例6: get_preview_from_url
public static function get_preview_from_url($url)
{
$preview = '';
$images = array('jpg', 'jpeg', 'bmp', 'gif', 'png');
if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
// check for extension, if it has extension then use it
$info = pathinfo($url);
if (isset($info['extension'])) {
if (in_array($info['extension'], $images)) {
$preview = $url;
} else {
$type = wp_ext2type($info['extension']);
if (is_null($type)) {
$type = 'default';
}
$preview = includes_url() . 'images/crystal/' . $type . '.png';
}
} else {
// if no extension, try to discover from mime
$mime = wp_remote_head($url);
if (!is_wp_error($mime)) {
$mime = $mime['headers']['content-type'];
if (strpos($mime, 'image') === 0) {
$preview = $url;
} else {
$preview = wp_mime_type_icon($mime);
}
} else {
$preview = includes_url() . 'images/crystal/' . 'default' . '.png';
}
}
}
return $preview;
}
示例7: sz_google_ajax_load_scripts
function sz_google_ajax_load_scripts()
{
wp_enqueue_style('sz-google-style-admin', plugin_dir_url(SZ_PLUGIN_GOOGLE_MAIN) . 'admin/files/css/sz-google-style-admin.css', array(), SZ_PLUGIN_GOOGLE_VERSION);
wp_enqueue_script('sz-google-javascript-widgets', plugin_dir_url(SZ_PLUGIN_GOOGLE_MAIN) . 'admin/files/js/jquery.szgoogle.widgets.js', array('jquery'), SZ_PLUGIN_GOOGLE_VERSION, false);
wp_enqueue_script('tiny_mce_popup', includes_url('js/tinymce/tiny_mce_popup.js'), array('jquery'), SZ_PLUGIN_GOOGLE_VERSION, false);
wp_enqueue_script('tiny_mce_component', plugin_dir_url(SZ_PLUGIN_GOOGLE_MAIN) . 'admin/mce/js/' . SZGOOGLE_AJAX_NAME . '.js', array('tiny_mce_popup'), SZ_PLUGIN_GOOGLE_VERSION, false);
}
示例8: test_wysiwyg_field
public function test_wysiwyg_field()
{
global $wp_version;
$this->field_test['fields'][0]['type'] = 'wysiwyg';
$cmb = new CMB2($this->field_test);
$field = cmb2_get_field($this->field_test['id'], 'field_test_field', $this->post_id);
$this->assertInstanceOf('CMB2_Field', $field);
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
$version = 'ver=' . $wp_version;
$field_gen = '
<div class="cmb-row cmb-type-wysiwyg cmb2-id-field-test-field">
<div class="cmb-td">
<label for="field_test_field">Name</label>
<div id="wp-field_test_field-wrap" class="wp-core-ui wp-editor-wrap html-active">
<link rel=\'stylesheet\' id=\'dashicons-css\' href=\'' . includes_url("css/dashicons{$suffix}.css?{$version}") . '\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'editor-buttons-css\' href=\'' . includes_url("css/editor{$suffix}.css?{$version}") . '\' type=\'text/css\' media=\'all\' />
<div id="wp-field_test_field-editor-container" class="wp-editor-container">
<textarea class="wp-editor-area" rows="20" cols="40" name="field_test_field" id="field_test_field">
</textarea>
</div>
</div>
<p class="cmb2-metabox-description">This is a description</p>
</div>
</div>
';
$this->assertEquals($this->clean_string($this->render_field($field)), $this->clean_string($field_gen));
}
示例9: index_action
function index_action($return = FALSE)
{
// If the site was accessed as http://foobar.com but the iframe/site_url() is http://www.foobar.com,
// then the JS will generate cross origin framing errors
if (isset($_GET['ngg_fix_cross_origins']) && isset($_SERVER['HTTP_REFERER'])) {
$referrer = parse_url($_SERVER['HTTP_REFERER']);
$host = parse_url(site_url());
$referrer = $referrer['host'];
$host = $host['host'];
if ($host != $referrer) {
$parts = explode('.', $host);
$host = implode('.', array_slice($parts, -2, 2));
if ($host == $referrer) {
header("X-Frame-Options: ALLOW-FROM {$host}");
}
}
}
$this->object->expires("1 year");
// IMPORTANT: The Displayed Gallery has already been fetched by the
// parent frame, and is available on the client side as
// window.galleries.gallery_[id] and therefore fetching the
// displayed gallery on the server side is strongly discouraged as it's
// a redundant database query. Instead, find a way to make use of the
// client side object
$protect_images = !empty(C_NextGen_Settings::get_instance()->protect_images) ? TRUE : FALSE;
return $this->object->render_view('photocrati-galleria#galleria_iframe', array('id' => $this->param('id'), 'jquery_url' => includes_url('/js/jquery/jquery.js'), 'galleria_url' => $this->get_static_url('photocrati-galleria#galleria-1.2.9.min.js'), 'galleria_instance_js' => $this->object->galleria_instance_js(), 'ngg_settings' => array('protect_images' => $protect_images)), $return);
}
示例10: __construct
/**
* constructeur
*/
public function __construct()
{
$this->_sPluginsURL = plugins_url();
$this->_sIncludesURL = includes_url();
// fonction de load js
add_action('wp_print_scripts', array($this, 'loadJS'));
}
示例11: et_fb_enqueue_assets
function et_fb_enqueue_assets()
{
global $wp_version;
et_fb_load_portability();
$ver = ET_BUILDER_VERSION;
$root = ET_BUILDER_URI;
$app = ET_FB_URI;
$assets = ET_FB_ASSETS_URI;
// Get WP major version
$wp_major_version = substr($wp_version, 0, 3);
// Register styles.
// wp_enqueue_style( 'et-frontend-builder', "{$assets}/css/frontend-builder.css", null, $ver );
// Register scripts.
// wp_register_script( 'minicolors', "{$root}/scripts/ext/jquery.minicolors.js" );
wp_register_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
wp_register_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false, 1);
wp_register_script('wp-color-picker-alpha', "{$root}/scripts/ext/wp-color-picker-alpha.min.js", array('wp-color-picker'));
$colorpicker_l10n = array('clear' => esc_html__('Clear', 'et_builder'), 'defaultString' => esc_html__('Default', 'et_builder'), 'pick' => esc_html__('Select Color', 'et_builder'), 'current' => esc_html__('Current Color', 'et_builder'));
wp_localize_script('wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n);
wp_register_script('react-tiny-mce', "{$assets}/vendors/tinymce.min.js");
if (version_compare($wp_major_version, '4.5', '<')) {
wp_register_script('et_pb_admin_date_js', "{$root}/scripts/ext/jquery-ui-1.10.4.custom.min.js", array('jquery'), $ver, true);
} else {
wp_register_script('et_pb_admin_date_js', "{$root}/scripts/ext/jquery-ui-1.11.4.custom.min.js", array('jquery'), $ver, true);
}
wp_register_script('et_pb_admin_date_addon_js', "{$root}/scripts/ext/jquery-ui-timepicker-addon.js", array('et_pb_admin_date_js'), $ver, true);
wp_register_script('wp-shortcode', includes_url() . '/js/shortcode.js', array(), $wp_version);
$fb_bundle_dependencies = apply_filters('et_fb_bundle_dependencies', array('jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-resizable', 'underscore', 'jquery-ui-sortable', 'jquery-effects-core', 'iris', 'wp-color-picker', 'wp-color-picker-alpha', 'react-tiny-mce', 'easypiechart', 'et_pb_admin_date_addon_js', 'salvattore', 'hashchange', 'wp-shortcode'));
// Enqueue scripts.
wp_enqueue_script('et-frontend-builder', "{$app}/bundle.js", $fb_bundle_dependencies, $ver, true);
// Enqueue failure notice script.
wp_enqueue_script('et-frontend-builder-failure', "{$assets}/scripts/failure_notice.js", array(), $ver, true);
wp_localize_script('et-frontend-builder-failure', 'et_fb_options', array('ajaxurl' => admin_url('admin-ajax.php'), 'et_admin_load_nonce' => wp_create_nonce('et_admin_load_nonce'), 'memory_limit_increased' => esc_html__('Your memory limit has been increased', 'et_builder'), 'memory_limit_not_increased' => esc_html__("Your memory limit can't be changed automatically", 'et_builder')));
do_action('et_fb_enqueue_assets');
}
示例12: enqueue_image_editor_scripts
function enqueue_image_editor_scripts()
{
$suffix = function_exists('rtm_get_script_style_suffix') ? rtm_get_script_style_suffix() : '.min';
wp_enqueue_script('wp-ajax-response');
wp_enqueue_script('rtmedia-image-edit', admin_url("js/image-edit{$suffix}.js"), array('jquery', 'json2', 'imgareaselect'), false, 1);
wp_enqueue_style('rtmedia-image-area-select', includes_url('/js/imgareaselect/imgareaselect.css'));
}
示例13: _tcg_load_theme_files
/**
* Load theme scripts in the footer
*
* Big thanks to Chris Ferdinandi on this one!
* ref: http://gomakethings.com/inlining-critical-css-for-better-web-performance/
*/
function _tcg_load_theme_files()
{
// If stylesheet is in browser cache, load it the traditional way
// Otherwise, inline critical CSS and load full stylesheet asynchronously
// See _tcg_initialize_theme_detects()
// Load theme fonts
wp_enqueue_style('_tcg-fonts', '//fonts.googleapis.com/css?family=Poiret+One');
// Load comment script from origina _s
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
// Re-enable & test this if browser paint delays
if (isset($_COOKIE['fullCSS']) && $_COOKIE['fullCSS'] === 'true') {
wp_enqueue_style('_tcg-theme-styles', get_template_directory_uri() . '/style.css', null, null, 'all');
}
// Move jquery to the footer
// it's being defer'd instead of async'd - move to header and load renderblocking in case of bugginess
// get rid of jquery-migrate cause we're too cocky and smart for that shit.
wp_deregister_script('jquery');
wp_dequeue_script('jquery');
wp_register_script('jquery-core', includes_url('/js/jquery/jquery.js'), false, NULL, true);
wp_enqueue_script('jquery-core');
// Add dependency to jquery-core for Asset Queue Manager, DO NOT load in footer or aqm fails
wp_register_script('asset-queue-manager', '/wp-content/plugins/asset-queue-manager/assets/js/aqm.min.js', 'jquery-core', NULL, false);
// Apparently enqueueing isn't necessary, may want to research this more
// wp_enqueue_script( 'asset-queue-manager' );
wp_register_script('_tcg-theme-scripts', get_template_directory_uri() . '/js/main.min.js', 'jquery-core', null, true);
wp_enqueue_script('_tcg-theme-scripts');
}
示例14: tshirt_designer_init_scripts
function tshirt_designer_init_scripts()
{
$tshirt_designer_sticker_size = get_option('tshirt_designer_sticker_size');
if (empty($tshirt_designer_sticker_size)) {
$tshirt_designer_sticker_size = intval(2 * 1000 * 1000);
} else {
$tshirt_designer_sticker_size = intval($tshirt_designer_sticker_size * 1000 * 1000);
}
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-widget');
wp_enqueue_script('jquery-ui-mouse');
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('jquery-ui-resizable');
wp_enqueue_style('jquery-ui.css', tshirt_designer_plugin_url . 'css/jquery-ui.css');
wp_enqueue_script('html2canvas.js', plugins_url('/js/html2canvas.js', __FILE__), array('jquery'), '1.0', false);
//wp_enqueue_script( 'circletype.js', plugins_url( '/js/circletype.js', __FILE__ ), array('jquery'), '1.0', false);
wp_enqueue_script('jscolor.js', plugins_url('/js/jscolor.js', __FILE__), array('jquery'), '1.0', false);
wp_enqueue_script('tshirt_designer_js', plugins_url('/js/scripts.js', __FILE__), array('jquery'));
wp_localize_script('tshirt_designer_js', 'tshirt_designer_ajax', array('tshirt_designer_ajaxurl' => admin_url('admin-ajax.php')));
wp_enqueue_style('tshirt_designer_style', tshirt_designer_plugin_url . 'css/style.css');
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('tshirt_designer_color_picker', plugins_url('/js/color-picker.js', __FILE__), false, true);
//ParaAdmin
wp_enqueue_style('ParaAdmin', tshirt_designer_plugin_url . 'ParaAdmin/css/ParaAdmin.css');
//wp_enqueue_style('ParaDashboard', tshirt_designer_plugin_url.'ParaAdmin/css/ParaDashboard.css');
//wp_enqueue_style('ParaIcons', tshirt_designer_plugin_url.'ParaAdmin/css/ParaIcons.css');
wp_enqueue_script('ParaAdmin', plugins_url('ParaAdmin/js/ParaAdmin.js', __FILE__), array('jquery'));
wp_enqueue_script('plupload-handlers');
wp_enqueue_script('sticker_upload', tshirt_designer_plugin_url . 'js/upload-sticker.js', array('jquery'));
wp_localize_script('sticker_upload', 'sticker_upload', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('sticker_upload'), 'remove' => wp_create_nonce('sticker_remove'), 'number' => 5, 'upload_enabled' => true, 'confirmMsg' => __('Are you sure you want to delete this?'), 'plupload' => array('runtimes' => 'html5,flash,html4', 'browse_button' => 'sticker-uploader', 'container' => 'sticker-upload-container', 'file_data_name' => 'sticker_upload_file', 'max_file_size' => $tshirt_designer_sticker_size . 'b', 'url' => admin_url('admin-ajax.php') . '?action=sticker_upload&nonce=' . wp_create_nonce('sticker_allow'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => 'gif,png')), 'multipart' => true, 'urlstream_upload' => true)));
}
示例15: register_scripts
static function register_scripts()
{
if (!wp_script_is('plupload-all')) {
wp_enqueue_script('plupload-all');
}
wp_enqueue_script('rtmedia-backbone', RTMEDIA_URL . 'app/assets/js/rtMedia.backbone.js', array('plupload-all', 'backbone'), false, true);
if (is_rtmedia_album_gallery()) {
$template_url = esc_url(add_query_arg(array("action" => 'rtmedia_get_template', "template" => "album-gallery-item"), admin_url("admin-ajax.php")), null, '');
} else {
$template_url = esc_url(add_query_arg(array("action" => 'rtmedia_get_template', "template" => apply_filters('rtmedia_backbone_template_filter', "media-gallery-item")), admin_url("admin-ajax.php")), null, '');
}
wp_localize_script('rtmedia-backbone', 'template_url', $template_url);
$url = trailingslashit($_SERVER["REQUEST_URI"]);
$rtmedia_slug = "/" . RTMEDIA_MEDIA_SLUG;
// check position of media slug from end of the URL
if (strrpos($url, $rtmedia_slug) !== false) {
// split the url upto the last occurance of media slug
$url_upload = substr($url, 0, strrpos($url, $rtmedia_slug));
$url = trailingslashit($url_upload) . "upload/";
} else {
$url = trailingslashit($url) . "upload/";
}
$params = array('url' => $url, 'runtimes' => 'html5,flash,html4', 'browse_button' => 'rtMedia-upload-button', 'container' => 'rtmedia-upload-container', 'drop_element' => 'drag-drop-area', 'filters' => apply_filters('rtmedia_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => get_rtmedia_allowed_upload_type()))), 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))), 'multipart' => true, 'urlstream_upload' => true, 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'file_data_name' => 'rtmedia_file', 'multi_selection' => true, 'multipart_params' => apply_filters('rtmedia-multi-params', array('redirect' => 'no', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER['REQUEST_URI'], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator(false, true))), 'max_file_size_msg' => apply_filters("rtmedia_plupload_file_size_msg", min(array(ini_get('upload_max_filesize'), ini_get('post_max_size')))));
if (wp_is_mobile()) {
$params['multi_selection'] = false;
}
$params = apply_filters("rtmedia_modify_upload_params", $params);
wp_localize_script('rtmedia-backbone', 'rtMedia_plupload_config', $params);
wp_localize_script('rtmedia-backbone', 'rMedia_loading_file', admin_url("/images/loading.gif"));
}