Version Description
(2009-06-30): = * Hook in earlier in the post selection process to fix PHP notices * Add uninstall functionality to remove options from the options table
Download this release
Release Info
Developer | ocean90 |
Plugin | Public Post Preview |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- public-post-preview.php +12 -6
- readme.txt +8 -4
- uninstall.php +8 -0
public-post-preview.php
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Public Post Preview
|
4 |
-
Plugin URI: http://sivel.net/wordpress/
|
5 |
Description: Enables you to give a link to anonymous users for public preview of a post before it is published.
|
6 |
Author: Matt Martz</a> and <a href='http://www.ginside.com/'>Jonathan Dingman</a>
|
7 |
-
Version: 1.
|
8 |
Author URI: http://sivel.net/
|
|
|
|
|
|
|
|
|
9 |
*/
|
10 |
|
11 |
class Public_Post_Preview {
|
@@ -99,15 +103,17 @@ class Public_Post_Preview {
|
|
99 |
if ( false == $this->verify_nonce($_GET['nonce'], 'public_post_preview_' . $this->id) || isset($preview_posts[$this->id]) )
|
100 |
wp_die('You do not have permission to publicly preview this post.');
|
101 |
|
102 |
-
add_filter('
|
103 |
}
|
104 |
}
|
105 |
|
106 |
-
//
|
107 |
-
function
|
108 |
-
$posts[] =
|
109 |
return $posts;
|
110 |
}
|
111 |
}
|
|
|
112 |
$Public_Post_Preview = new Public_Post_Preview();
|
|
|
113 |
?>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Public Post Preview
|
4 |
+
Plugin URI: http://sivel.net/wordpress/
|
5 |
Description: Enables you to give a link to anonymous users for public preview of a post before it is published.
|
6 |
Author: Matt Martz</a> and <a href='http://www.ginside.com/'>Jonathan Dingman</a>
|
7 |
+
Version: 1.3
|
8 |
Author URI: http://sivel.net/
|
9 |
+
|
10 |
+
Copyright (c) 2009-2010 Matt Martz (http://sivel.net)
|
11 |
+
Public Post Preview is released under the GNU General Public License (GPL)
|
12 |
+
http://www.gnu.org/licenses/gpl-2.0.txt
|
13 |
*/
|
14 |
|
15 |
class Public_Post_Preview {
|
103 |
if ( false == $this->verify_nonce($_GET['nonce'], 'public_post_preview_' . $this->id) || isset($preview_posts[$this->id]) )
|
104 |
wp_die('You do not have permission to publicly preview this post.');
|
105 |
|
106 |
+
add_filter('posts_results', array(&$this, 'fake_publish'));
|
107 |
}
|
108 |
}
|
109 |
|
110 |
+
// Fake the post being published so we don't have to do anything *too* hacky to get it to load the preview
|
111 |
+
function fake_publish($posts) {
|
112 |
+
$posts[0]->post_status = 'publish';
|
113 |
return $posts;
|
114 |
}
|
115 |
}
|
116 |
+
|
117 |
$Public_Post_Preview = new Public_Post_Preview();
|
118 |
+
|
119 |
?>
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Public Post Preview ===
|
2 |
-
Contributors: sivel, jdingman
|
3 |
-
Donate Link:
|
4 |
Tags: public-post-preview, public, post, preview, posts
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 2.9
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Enables you to give a link to anonymous users for public preview of a post before it is published.
|
10 |
|
@@ -38,7 +38,11 @@ NOTE: See "Other Notes" for Upgrade and Usage Instructions as well as other pert
|
|
38 |
1. By default all posts in draft or pending review status will have public preview links that can be found diretly below the edit post box.
|
39 |
1. To disable public post preview for a specific post uncheck the public preview post box and save the post.
|
40 |
|
41 |
-
==
|
|
|
|
|
|
|
|
|
42 |
|
43 |
= 1.2 (2009-03-30): =
|
44 |
* Fix preview URL for scheduled posts on sites with a permalink other than default activated.
|
1 |
=== Public Post Preview ===
|
2 |
+
Contributors: ocean90, sivel, jdingman
|
3 |
+
Donate Link: http://sivel.net/donate
|
4 |
Tags: public-post-preview, public, post, preview, posts
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 2.9
|
7 |
+
Stable tag: 1.3
|
8 |
|
9 |
Enables you to give a link to anonymous users for public preview of a post before it is published.
|
10 |
|
38 |
1. By default all posts in draft or pending review status will have public preview links that can be found diretly below the edit post box.
|
39 |
1. To disable public post preview for a specific post uncheck the public preview post box and save the post.
|
40 |
|
41 |
+
== Change Log ==
|
42 |
+
|
43 |
+
= 1.3 (2009-06-30): =
|
44 |
+
* Hook in earlier in the post selection process to fix PHP notices
|
45 |
+
* Add uninstall functionality to remove options from the options table
|
46 |
|
47 |
= 1.2 (2009-03-30): =
|
48 |
* Fix preview URL for scheduled posts on sites with a permalink other than default activated.
|
uninstall.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// If uninstall/delete not called from WordPress then exit
|
3 |
+
if ( ! defined('ABSPATH') && ! defined('WP_UNINSTALL_PLUGIN') )
|
4 |
+
exit();
|
5 |
+
|
6 |
+
// Delete option from options table
|
7 |
+
delete_option('public_post_preview');
|
8 |
+
?>
|