Changeset 588957
- Timestamp:
- 08/22/2012 06:36:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
unpublished-warnings/trunk/unpublished_warnings.php
r535283 r588957 4 4 Plugin URI: http://wordpress.org/extend/plugins/unpublished-warnings/ 5 5 Description: This plugin will warn you when you're looking at an unpublished post that you just happen to be able to see. 6 Author: BillSullivan6 Author: William Sullivan 7 7 Version: 0.3.6 8 8 Author URI: http://enkrates.com … … 30 30 31 31 function UW_is_unpublished(){ 32 return !( isset( $_GET['preview'] ) && $_GET['preview'] == 'true' ) && get_post_status( get_the_ID() ) != 'publish'; 32 return !( isset( $_GET['preview'] ) && $_GET['preview'] == 'true' ) 33 && get_post_status( get_the_ID() ) != 'publish'; 33 34 } 34 35 35 36 function UW_prepend_warning( $content ){ 36 37 if ( UW_is_unpublished() ){ 37 $warning_message = 'This post has not yet been published. You can see it because you are logged in with a privileged account.'; 38 $warning_message = 'This post has not yet been published. ' . 39 'You can see it because you are logged ' . 40 'in with a privileged account.'; 38 41 $hide_me_message = 'Click here to hide this warning.'; 39 $content = "<div id='unpublished_warnings'><p>" . wptexturize( $warning_message ) . "</p>\n<p>" 40 . wptexturize( $hide_me_message ) . "</p>\n</div>\n" . $content; 42 $content = "<div id='unpublished_warnings'><p>" . 43 wptexturize( $warning_message ) . 44 "</p>\n<p>" . 45 wptexturize( $hide_me_message ) . 46 "</p>\n</div>\n" . $content; 41 47 } 42 48 return $content;
Note: See TracChangeset
for help on using the changeset viewer.