Changeset 1738142
- Timestamp:
- 09/29/2017 06:29:38 AM (9 years ago)
- Location:
- wp-dev-notice/trunk
- Files:
-
- 1 deleted
- 2 edited
-
constants.php (deleted)
-
functions.php (modified) (2 diffs)
-
wp-dev-notice.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-dev-notice/trunk/functions.php
r1737364 r1738142 8 8 # Inject notice markup 9 9 function 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 15 17 } 16 18 17 19 # Display notice in frontend 18 if (! WP_DEV_NOTICE_HIDE_IN_FRONTEND) {20 if (!defined('WP_DEV_NOTICE_HIDE_IN_FRONTEND') or !WP_DEV_NOTICE_HIDE_IN_FRONTEND) { 19 21 add_action( 'wp_enqueue_scripts', 'wp_dev_notice_styles' ); 20 22 add_action( 'wp_footer', 'wp_dev_notice_scripts' ); … … 22 24 23 25 # Display notice in backend 24 if (! WP_DEV_NOTICE_HIDE_IN_BACKEND){26 if (!defined('WP_DEV_NOTICE_HIDE_IN_BACKEND') or !WP_DEV_NOTICE_HIDE_IN_BACKEND) { 25 27 add_action( 'admin_enqueue_scripts', 'wp_dev_notice_styles' ); 26 28 add_action( 'admin_footer', 'wp_dev_notice_scripts' ); -
wp-dev-notice/trunk/wp-dev-notice.php
r1737349 r1738142 4 4 Plugin URI: https://github.com/anx-hnezbeda/wp-dev-notice 5 5 Description: A WordPress plugin that displays a notification if you are working on a dev environment 6 Version: 1. 06 Version: 1.1 7 7 Author: Harald Nezbeda 8 8 Author URI: http://www.nezhar.com … … 14 14 * Load plugin class files 15 15 */ 16 include_once('constants.php');17 16 include_once('functions.php');
Note: See TracChangeset
for help on using the changeset viewer.