Categories
Package/plugin/module WordPress

Stealth Publish v2.0

I’d like to announce the official release of the updated Stealth Publish plugin (v2.0) for WordPress.

Prevent specified posts from being featured on the front page or in feeds, and from notifying external services of publication.

Recommended major update! Highlights: re-implemented; silently publish stealth posts; added filters and CSS class for customization; use hidden custom field; localization support; misc. non-functionality changes; verified WP 3.0 compatibility; dropped compatibility with version of WP older than 2.9.

For more details, instructions, screenshots, and the download link, visit the plugin’s official homepage at :
coffee2code.com/wp-plugins/stealth-publish/.

Comments welcome on this post for this version of the plugin. Comments will be closed once this release has been superseded by another.

Read more for a detailed ChangeLog of the release.

Detailed ChangeLog

These are the detailed changes, which may or may not make sense to you depending on your familiarity with the previous features and internals of the plugin.

  • Encapsulate all code in new c2c_StealthPublish class
  • Now also silently publish posts that are stealth published (i.e. don’t send out pingbacks, tracbacks, and pings to update services)
  • Add checkbox labeled “Stealth publish?” to Publish meta_box rather than requiring direct use of custom fields
  • Allow overriding of custom field used via ‘stealth_publish_meta_key’ filter (default value is ‘_stealth_publish’)
  • Add filter ‘stealth_publish_meta_key’ to allow overriding custom field key name
  • Add filter ‘stealth_publish_silent’ to allow overriding silent publish feature
  • Add class of ‘c2c-stealth-publish’ to admin UI div containing checkbox
  • Change custom field used to be a hidden custom field by prepending ‘_’ to the name
  • Accept second arg to stealth_publish_where()
  • Completely re-implemented find_stealth_published_post_ids()
  • Full support for localization
  • Store plugin instance in global variable, $c2c_stealth_publish, to allow for external manipulation
  • Remove docs from top of plugin file (all that and more are in readme.txt)
  • Minor code reformatting (spacing)
  • Add PHPDoc documentation
  • Note compatibility with WP 3.0+
  • Drop compatibility with versions of WP older than 2.9
  • Add screenshots
  • Update copyright date
  • Add package info to top of plugin file
  • Add Changelog, Filters, and Upgrade Notice sections to readme.txt
  • Add .pot file
  • Add to plugin repository

15 replies on “Stealth Publish v2.0”

Not without some custom code. You can put the following into your active theme’s functions.php file. It works for me, but I don’t warrant it in any way.


// Cribbed from http://www.php.net/manual/en/function.strip-tags.php#93414
function c2c_strip_selected_tags( $str, $tags = "", $strip_content = false ) {
  preg_match_all( "/<([^>]+)>/i", $tags, $allTags, PREG_PATTERN_ORDER );
  foreach ( $allTags[1] as $tag ) {
    $replace = "%(<$tag.*?>)(.*?)(<\/$tag.*?>)%is";
    $replace2 = "%(<$tag.*?>)%is";
    if ( $strip_content ) {
      $str = preg_replace( $replace, '', $str );
      $str = preg_replace( $replace2, '', $str );
    }
    $str = preg_replace( $replace, '${2}', $str );
    $str = preg_replace( $replace2, '${2}', $str );
  }
  return $str;
}
function my_remove_tables( $content ) {
  return c2c_strip_selected_tags( $content, '<table>', true );
}
add_filter( 'the_content_feed', 'my_remove_tables' );

Hey Scott,

thank you for the great plugin. There is a problem with WP 3.01 though. It doesn’t work anymore. Excluded posts just show up both in the RSS feed and on the HP. I use version 2.0 of the plugin now. As I’ve updated both the plugin and WordPress itself on the same day I have no idea what caused the bug.

Anyways, I appreciate your work very much. I hope we’ll find a solution as I depend on your plugin for a directory inside of my blog. I don’t want to annoy regular blog readers with directory entries.

Sincerely, tad

What doesn’t work? What version of WordPress are you using? It would be best for everyone to fix the latest release than have you run an earlier version.

I have installed the new version (2.0) on a handful of my blogs. I am getting the error…

Warning: Missing argument 2 for c2c_StealthPublish::stealth_publish_where() in /home2/xxxxx/public_html/xxxxxx/wp-content/plugins/stealth-publish/stealth-publish.php on line 159

I get this error on any blog I install it on (2.9.2 or 3.0.1).

Using mostly WP 2.9.2

Any fix?

Regards,

Ken Roberts

Articles i had used used stealth publish were not indicated on the RSS Feed and the front page (that works). But the earlier version hat also show these Articels on a underside i have created with the Post page associator Plugin. The new Version doesnt show the articels i had used stealth publish on these sites.

Unfortunately, I have no storage of the previous Stealth Publish version.

Where can i get these version then?

Ken: I’ve updated the plugin to v2.0.1. Try that out once it becomes available for updating. It should fix the issue you encountered, but let me know. Thanks.

Hey, did you get my last comment? Or diid you delete it by accident? I figured out that now you added a checkbox 😉

I have feature request though: I’d like to be able to control how much I hide: I like to show the stealth post in the “recent posts” list for example whereas the HP and RSS should stay clean.

Bella: Just so I’m clear, the plugin properly functions by removing stealth published posts from RSS feeds and from the front page main listing. However, you use the Post Page Associator plugin to list posts in your sidebar and the stealth-published posts don’t appear there with the latest version of this plugin (but appeared there with the earlier version of the plugin)?

If so, that was my goal, for the post to essentially not be listable on the front blog page. However, I can see how this isn’t something everyone may want. I plan on making it so you can disable that particular functionality. So keep an eye out for future releases. I may try using the Post Page Associator plugin to reproduce what you are trying to do. If you don’t object, I may email you in the future with a few questions.

In the meantime, you can obtain v1.0 of the plugin here. I’m about to release v2.0.2, if you wanted to give that a try as well.

Ken: I just released v2.0.2 which should fix that issue. Thanks for reporting! Let me know if that didn’t the trick for you.

Tad: Your comments ended up flagged by Akismet as spam, so I didn’t see them until you wrote me on Twitter. Since you originally posted your comment, the plugin has been updated to v2.0.2. Have you tried out the latest version? What version of WP are you using?

I agree with your feature request, though. In a future version of the plugin I plan to have separate settings to control how stealthy the post should be (i.e. Hide from feeds? Hide from home page? Hide from sidebar?)

Scott – Great plugin! It does exactly what I want. I have one glitch though and hoping you can help. When I stealth publish a post to a category and then click into the title of the post to reveal the “Leave a Comment” box on the bottom, everything disappears including my Twitter button, Related Posts, etc. What could be causing this? On some posts that I stealth publish it works fine.

Here is one where it’s not working:

www.virtuesforlife.com/forgiving-my-father/

Here is one where it is working:

www.virtuesforlife.com/immaculee-ilibagiza-i-forgive-you/

Any help would be greatly appreciated!

Stacey

Scott – Please ignore my last comment. I figured it out. I made a page into a post and did not delete the page so it was reading the page because that was the same permalink. Once I deleted the page, the problem was corrected.

Love your plugin!

Stacey

Comments are closed.