Esempio n. 1
0
 function admin_scripts()
 {
     wp_enqueue_media();
     pl_enqueue_color_picker();
     pl_load_codemirror(pl_framework_url('plugins'));
     wp_enqueue_script('pl-admin', pl_framework_url('js') . '/admin.js', array('jquery', 'wp-color-picker'));
     wp_enqueue_style('pl-components', pl_framework_url('css') . '/components.css');
     wp_enqueue_style('pl-admin', pl_framework_url('css') . '/admin.css');
     global $plfactory;
     $config = apply_filters('pl_admin_json', array('ajaxurl' => pl_ajax_url(), 'baseURL' => $this->base_url, 'cachekey' => $this->cache_key . $this->current_admin_page(), 'sections' => $plfactory->section_ids, 'security' => wp_create_nonce('pl-ajax-nonce'), 'extendURL' => PL_Platform()->url('extend')));
     wp_localize_script('pl-admin', 'PLAdmin', $config);
 }
Esempio n. 2
0
 function json()
 {
     $config = array('base' => $this->base_url, 'cache_url' => $this->cache_url, 'access_token' => $this->get_user_token(), 'rnd' => $this->get_cache_key(), 'ajaxurl' => pl_ajax_url(), 'baseURL' => $this->platform->base_url);
     wp_localize_script($this->platform->slug, 'plplatform', $config);
 }
Esempio n. 3
0
 function workarea_config()
 {
     global $pl_medialib, $pl_notifications;
     $a = array('siteName' => get_bloginfo('name'), 'siteDescription' => get_bloginfo('description'), 'plURL' => get_template_directory_uri(), 'siteURL' => do_shortcode('[pl_site_url]'), 'homeURL' => do_shortcode('[pl_home_url]'), 'uploadsURL' => do_shortcode('[pl_uploads_url]'), 'adminURL' => admin_url(), 'PLUI' => pl_framework_url('ui'), 'frontPage' => get_option('show_on_front', 'posts'), 'ajaxURL' => pl_ajax_url(), 'security' => wp_create_nonce('pl-ajax-nonce'), 'models' => array());
     $a['factory'] = $this->set_factory();
     // Edit current post URL
     $a['editPost'] = plns_edit_post_link();
     // Add menus URL
     $a['menus'] = admin_url("nav-menus.php");
     // Add/edit widgets URL
     $a['widgets'] = admin_url("widgets.php");
     // URL of core framework
     $a['CoreURL'] = get_template_directory_uri();
     // URL of parent theme
     $a['ParentStyleSheetURL'] = get_template_directory_uri();
     // URL of child theme, if active
     $a['ChildStyleSheetURL'] = get_stylesheet_directory_uri();
     $a['extendURL'] = function_exists('PL_Platform') ? PL_Platform()->url('extend') : '';
     // Media library link for use in iFrame
     $a['mediaLibrary'] = $pl_medialib->pl_media_library_link();
     //  Media library videos link for use in iFrame
     $a['mediaLibraryVideo'] = $pl_medialib->pl_media_library_link("video");
     // Add media link
     $a['addMediaURL'] = admin_url("media-new.php");
     // ID of the currently active user
     $a['userID'] = wp_get_current_user()->ID;
     // A cache key for various settings
     $a['CacheKey'] = pl_cache_key();
     // Is the user on localhost
     $a['LocalHost'] = pl_is_local();
     // Is developer mode activated?
     $a['debug'] = pl_dev_mode() ? 'true' : 'false';
     $a['btns'] = pl_btn_classes();
     $a['btnSizes'] = pl_button_sizes();
     $a['imgSizes'] = get_intermediate_image_sizes();
     $a['animations'] = pl_animations();
     $a['taxes'] = pl_get_taxonomies();
     $a['icons'] = pl_icons();
     $a['menus'] = pl_get_menus();
     $a['sidebars'] = pl_get_sidebars();
     $a['notifications'] = $pl_notifications;
     $a['urls'] = pl_get_system_urls();
     $a['translate'] = array();
     $a['locale'] = get_locale();
     return apply_filters('pl_workarea_json', $a);
 }
Esempio n. 4
0
/**
 * Global AjaxURL variable
 * http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/
 *
 * @return string The WP url used for ajax requests
 */
function pl_get_ajax_url()
{
    $ajax_url = pl_ajax_url();
    if (has_action('pl_force_ssl')) {
        $ajax_url = str_replace('http://', 'https://', $ajax_url);
    }
    return $ajax_url;
}