Plugin Directory

Changeset 2316082


Ignore:
Timestamp:
06/01/2020 07:13:42 PM (6 years ago)
Author:
btopro
Message:

banners

Location:
haxtheweb/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • haxtheweb/trunk/haxtheweb.php

    r2309700 r2316082  
    22/**
    33 * @package haxtheweb
    4  * @version 3.9.3
     4 * @version 3.9.4
    55 */
    66/*
     
    99Description: An ecosystem agnostic web editor to democratise the web and liberate users of platforms.
    1010Author: Bryan Ollendyke
    11 Version: 3.9.3
     11Version: 3.9.4
    1212Author URI: https://haxtheweb.org/
    1313*/
     
    3939// Wire up HAX to hijack the Classic editor
    4040function haxtheweb_wordpress($hook) {
     41  global $haxthewebLoadDeps;
     42  // all requests default to allowing the pass through
     43  $haxthewebLoadDeps = true;
    4144  if ($hook == 'options-writing.php') {
    4245    wp_enqueue_script('haxtheweb_the_press', plugins_url('js/hax-form-helper.js', __FILE__), array(), false, true );
    4346  }
    44   if ($hook == 'post.php' || $hook == 'post-new.php') {
     47  else if ($hook == 'post.php' || $hook == 'post-new.php') {
    4548    wp_enqueue_script('haxtheweb_the_press', plugins_url('js/hax-the-press.js', __FILE__), array(), false, true );
    4649    wp_register_style('haxtheweb_stylesheet', plugins_url('css/haxtheweb.css', __FILE__));
    4750    wp_enqueue_style( 'haxtheweb_stylesheet' );
    4851  }
    49   if ($hook == 'upload.php') {
    50     global $haxthewebUploadPage;
    51     $haxthewebUploadPage = true;
     52  else if (is_admin()) {
     53    $haxthewebLoadDeps = false;
    5254  }
    5355}
     
    659661}
    660662
     663// admin wrapper to test pages we know HAX can't load on in the admin side
     664function haxtheweb_deps_admin() {
     665  // stupid hack to ensure that we don't screw up admin pages that can't run this
     666  global $haxthewebLoadDeps;
     667  if ($haxthewebLoadDeps) {
     668    haxtheweb_deps();
     669  }
     670}
    661671// Wire up web components to WordPress
    662672function haxtheweb_deps() {
    663   // stupid hack to ensure that we don't screw up the upload.php page
    664   global $haxthewebUploadPage;
    665   if (!$haxthewebUploadPage) {
    666     $location = get_option( 'haxtheweb_location', WP_HAXTHEWEB_WEBCOMPONENTS_LOCATION );
    667     if ($location == 'other') {
    668     $location = get_option( 'haxtheweb_location_other', '' );
    669     }
    670     $buildLocation = $location;
    671     // support for build file to come local but assets via CDN
    672     if (get_option('haxtheweb_local_build_file', false)) {
    673       $buildLocation = content_url('haxtheweb/');
    674     }
    675     $wc = new WebComponentsService();
    676     print $wc->applyWebcomponents($buildLocation, $location);
    677   }
     673  $location = get_option( 'haxtheweb_location', WP_HAXTHEWEB_WEBCOMPONENTS_LOCATION );
     674  if ($location == 'other') {
     675  $location = get_option( 'haxtheweb_location_other', '' );
     676  }
     677  $buildLocation = $location;
     678  // support for build file to come local but assets via CDN
     679  if (get_option('haxtheweb_local_build_file', false)) {
     680    $buildLocation = content_url('haxtheweb/');
     681  }
     682  $wc = new WebComponentsService();
     683  print $wc->applyWebcomponents($buildLocation, $location);
    678684}
    679685// front end paths
    680686add_action( 'wp_footer', 'haxtheweb_deps' );
    681687// back end paths
    682 add_action( 'admin_footer', 'haxtheweb_deps' );
     688add_action( 'admin_footer', 'haxtheweb_deps_admin' );
    683689?>
  • haxtheweb/trunk/readme.txt

    r2309700 r2316082  
    55Requires at least: 4.9
    66Tested up to: 5.4
    7 Stable tag: 3.9.3
     7Stable tag: 3.9.4
    88Requires PHP: 7.0
    99License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.