Plugin Directory

Changeset 1738142


Ignore:
Timestamp:
09/29/2017 06:29:38 AM (9 years ago)
Author:
nezhar
Message:

Fixes config loading

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

Legend:

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

    r1737364 r1738142  
    88# Inject notice markup
    99function wp_dev_notice_scripts(){
    10   ?>
    11   <script>
    12     document.body.innerHTML += "<div class='<?php echo WP_DEV_NOTICE_CLASS; ?>'><?php echo WP_DEV_NOTICE_MESSAGE; ?></div>";
    13   </script>
    14   <?php
     10    $wpDevNoticeMessage =  (defined('WP_DEV_NOTICE_MESSAGE')) ? WP_DEV_NOTICE_MESSAGE : 'You are working on a dev environment';
     11    $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
    1517}
    1618
    1719# Display notice in frontend
    18 if (!WP_DEV_NOTICE_HIDE_IN_FRONTEND) {
     20if (!defined('WP_DEV_NOTICE_HIDE_IN_FRONTEND') or !WP_DEV_NOTICE_HIDE_IN_FRONTEND) {
    1921    add_action( 'wp_enqueue_scripts', 'wp_dev_notice_styles' );
    2022    add_action( 'wp_footer', 'wp_dev_notice_scripts' );
     
    2224
    2325# Display notice in backend
    24 if (!WP_DEV_NOTICE_HIDE_IN_BACKEND) {
     26if (!defined('WP_DEV_NOTICE_HIDE_IN_BACKEND') or !WP_DEV_NOTICE_HIDE_IN_BACKEND) {
    2527    add_action( 'admin_enqueue_scripts', 'wp_dev_notice_styles' );
    2628    add_action( 'admin_footer', 'wp_dev_notice_scripts' );
  • wp-dev-notice/trunk/wp-dev-notice.php

    r1737349 r1738142  
    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.0
     6Version: 1.1
    77Author: Harald Nezbeda
    88Author URI: http://www.nezhar.com
     
    1414 * Load plugin class files
    1515 */
    16 include_once('constants.php');
    1716include_once('functions.php');
Note: See TracChangeset for help on using the changeset viewer.