Plugin Directory

Changeset 1751362


Ignore:
Timestamp:
10/23/2017 06:30:13 PM (8 years ago)
Author:
nezhar
Message:

Fixes loading priority

Location:
wp-dev-notice/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-dev-notice/trunk/functions.php

    r1738142 r1751362  
    77
    88# Inject notice markup
    9 function wp_dev_notice_scripts(){
     9function wp_dev_notice_scripts() {
    1010    $wpDevNoticeMessage =  (defined('WP_DEV_NOTICE_MESSAGE')) ? WP_DEV_NOTICE_MESSAGE : 'You are working on a dev environment';
    1111    $wpDevNoticeClass =  (defined('WP_DEV_NOTICE_CLASS')) ? WP_DEV_NOTICE_CLASS : 'wp-dev-notice wp-dev-notice-warning';
    12     ?>
    13 <script>
    14     document.body.innerHTML += "<div class='<?php echo $wpDevNoticeClass; ?>'><?php echo $wpDevNoticeMessage; ?></div>";
    15 </script>
    16     <?php
     12    echo "<script>document.body.innerHTML += \"<div class='{$wpDevNoticeClass}'>{$wpDevNoticeMessage}</div>\";</script>";
    1713}
    1814
    1915# Display notice in frontend
    2016if (!defined('WP_DEV_NOTICE_HIDE_IN_FRONTEND') or !WP_DEV_NOTICE_HIDE_IN_FRONTEND) {
    21     add_action( 'wp_enqueue_scripts', 'wp_dev_notice_styles' );
    22     add_action( 'wp_footer', 'wp_dev_notice_scripts' );
     17    add_action( 'wp_enqueue_scripts', 'wp_dev_notice_styles', 999 );
     18    add_action( 'wp_footer', 'wp_dev_notice_scripts', 999 );
    2319}
    2420
    2521# Display notice in backend
    2622if (!defined('WP_DEV_NOTICE_HIDE_IN_BACKEND') or !WP_DEV_NOTICE_HIDE_IN_BACKEND)  {
    27     add_action( 'admin_enqueue_scripts', 'wp_dev_notice_styles' );
    28     add_action( 'admin_footer', 'wp_dev_notice_scripts' );
     23    add_action( 'admin_enqueue_scripts', 'wp_dev_notice_styles', 999 );
     24    add_action( 'admin_footer', 'wp_dev_notice_scripts', 999 );
    2925}
  • wp-dev-notice/trunk/wp-dev-notice.php

    r1738142 r1751362  
    44Plugin URI: https://github.com/anx-hnezbeda/wp-dev-notice
    55Description: A WordPress plugin that displays a notification if you are working on a dev environment
    6 Version: 1.1
     6Version: 1.2
    77Author: Harald Nezbeda
    88Author URI: http://www.nezhar.com
Note: See TracChangeset for help on using the changeset viewer.