Changeset 2316082
- Timestamp:
- 06/01/2020 07:13:42 PM (6 years ago)
- Location:
- haxtheweb/trunk
- Files:
-
- 2 edited
-
haxtheweb.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
haxtheweb/trunk/haxtheweb.php
r2309700 r2316082 2 2 /** 3 3 * @package haxtheweb 4 * @version 3.9. 34 * @version 3.9.4 5 5 */ 6 6 /* … … 9 9 Description: An ecosystem agnostic web editor to democratise the web and liberate users of platforms. 10 10 Author: Bryan Ollendyke 11 Version: 3.9. 311 Version: 3.9.4 12 12 Author URI: https://haxtheweb.org/ 13 13 */ … … 39 39 // Wire up HAX to hijack the Classic editor 40 40 function haxtheweb_wordpress($hook) { 41 global $haxthewebLoadDeps; 42 // all requests default to allowing the pass through 43 $haxthewebLoadDeps = true; 41 44 if ($hook == 'options-writing.php') { 42 45 wp_enqueue_script('haxtheweb_the_press', plugins_url('js/hax-form-helper.js', __FILE__), array(), false, true ); 43 46 } 44 if ($hook == 'post.php' || $hook == 'post-new.php') {47 else if ($hook == 'post.php' || $hook == 'post-new.php') { 45 48 wp_enqueue_script('haxtheweb_the_press', plugins_url('js/hax-the-press.js', __FILE__), array(), false, true ); 46 49 wp_register_style('haxtheweb_stylesheet', plugins_url('css/haxtheweb.css', __FILE__)); 47 50 wp_enqueue_style( 'haxtheweb_stylesheet' ); 48 51 } 49 if ($hook == 'upload.php') { 50 global $haxthewebUploadPage; 51 $haxthewebUploadPage = true; 52 else if (is_admin()) { 53 $haxthewebLoadDeps = false; 52 54 } 53 55 } … … 659 661 } 660 662 663 // admin wrapper to test pages we know HAX can't load on in the admin side 664 function 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 } 661 671 // Wire up web components to WordPress 662 672 function 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); 678 684 } 679 685 // front end paths 680 686 add_action( 'wp_footer', 'haxtheweb_deps' ); 681 687 // back end paths 682 add_action( 'admin_footer', 'haxtheweb_deps ' );688 add_action( 'admin_footer', 'haxtheweb_deps_admin' ); 683 689 ?> -
haxtheweb/trunk/readme.txt
r2309700 r2316082 5 5 Requires at least: 4.9 6 6 Tested up to: 5.4 7 Stable tag: 3.9. 37 Stable tag: 3.9.4 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.