Changeset 1751362
- Timestamp:
- 10/23/2017 06:30:13 PM (8 years ago)
- Location:
- wp-dev-notice/trunk
- Files:
-
- 2 edited
-
functions.php (modified) (1 diff)
-
wp-dev-notice.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-dev-notice/trunk/functions.php
r1738142 r1751362 7 7 8 8 # Inject notice markup 9 function wp_dev_notice_scripts() {9 function wp_dev_notice_scripts() { 10 10 $wpDevNoticeMessage = (defined('WP_DEV_NOTICE_MESSAGE')) ? WP_DEV_NOTICE_MESSAGE : 'You are working on a dev environment'; 11 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 12 echo "<script>document.body.innerHTML += \"<div class='{$wpDevNoticeClass}'>{$wpDevNoticeMessage}</div>\";</script>"; 17 13 } 18 14 19 15 # Display notice in frontend 20 16 if (!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 ); 23 19 } 24 20 25 21 # Display notice in backend 26 22 if (!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 ); 29 25 } -
wp-dev-notice/trunk/wp-dev-notice.php
r1738142 r1751362 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. 16 Version: 1.2 7 7 Author: Harald Nezbeda 8 8 Author URI: http://www.nezhar.com
Note: See TracChangeset
for help on using the changeset viewer.