Prevent specified posts from being featured on the front page or in feeds, and from notifying external services of publication.
This plugin allows you to prevent specified posts from being featured on the front page or in feeds, and from notifying external services of publication. Beneficial in instances where you want to publish new content without any fanfare and just want the post added to archive and category pages and its own permalink page.
A “Stealth publish?” checkbox is added to the “Write Post” admin page. Posts which are saved with that checkbox checked will no longer be featured on the front page of the blog, nor will the post be included in any feeds.
A stealth published post will also not notify any external services about the publication. This includes not sending out pingbacks, trackbacks, and pings to update services such as pingomatic.com. This behavior can be overridden via the ‘c2c_stealth_publish_silent’ filter (see Filters section).
NOTES:
Use of other plugins making their own queries against the database to find posts will possibly allow a post to appear on the front page. But use of the standard WordPress functions for retrieving posts (as done for the main posts query and the recent posts widget) should not allow stealth published posts to appear on the home page.
If you use this plugin, you do not need to use my Silent Publish plugin as that functionality is incorporated into this plugin. Alternatively, if you like the silent publishing feature but want your new posts to appear on your blog’s front page and in feeds, then just use the “Silent Publish” plugin.
The plugin records when a post is stealth published, so subsequent edits of the post will have the “Stealth publish?” checkbox checked by default.
Links: Plugin Homepage | Plugin Directory Page | Author Homepage
The plugin is further customizable via three filters. Typically, these customizations would be put into your active theme’s functions.php file, or used by another plugin.
The ‘c2c_stealth_publish_meta_key’ filter allows you to override the name of the custom field key used by the plugin to store a post’s stealth publish status. This isn’t a common need.
Arguments:
Example:
/** * Defines a custom meta key to be used by Stealth Publish. * * @param string $custom_field_key The default custom field key name. * @return string */ function override_stealth_publish_key( $custom_field_key ) { return '_my_custom_stealth-publish'; } add_filter( 'c2c_stealth_publish_meta_key', 'override_stealth_publish_key' );
The ‘c2c_stealth_publish_silent’ filter allows you to override whether the plugin also ensure the post gets published silently (i.e. without sending out pingbacks, tracbacks, and pings to update services).
Arguments:
Example:
/** * Disable silent publishing for stealth published posts. * * @param bool $publish_silently True if the post is to be published silently. * @param int $post_id The post ID. * @return Always false. */ function override_stealth_publish_silent( $publish_silently, $post_id ) { return false; } add_filter( 'c2c_stealth_publish_silent', 'override_stealth_publish_silent' );
The ‘c2c_stealth_publish_default’ filter allows you to override the default state of the ‘Stealth Publish?’ checkbox.
Arguments:
Example:
// Have the Stealth Publish? checkbox checked by default. add_filter( 'c2c_stealth_publish_default', '__return_true' );
stealth-publish.zip
inside the /wp-content/plugins/
directory (or install via the built-in WordPress plugin installer)A screenshot of the 'Publish' sidebar box on the Add New Post admin page. The 'Stealth publish?' checkbox is integrated alongside the existing fields.
A screenshot of the 'Stealth publish?' checkbox displaying help text when hovering over the checkbox.
A screenshot of the 'Stealth publish?' checkbox in the quick edit form.
A screenshot of the icon adjacent to the post date for a post that has stealth publish enabled.
This is probably the kind of thing that you would recognize the need for or you don’t. It’s beneficial in instances where you want to publish new content without any fanfare and just want the post added to archive and category pages and its own permalink page.
Yes. See the Filters section (under Other Notes) and look for the example using the ‘c2c_stealth_publish_default’ filter. You’ll have to put that code into a site-specific plugin or your active theme’s functions.php file.
The checkbox is always present since it continues to have an effect on published posts, such as preventing the post from appearing on the front page or in feeds. You may, after publication, decide to not have the post be stealthy. In such a case, you can do so directly by editing the post and unchecking the checkbox; you do not need to change it back to a draft and then republish it.
(This is a developer-level question that doesn’t affect general users.) The plugin assigns a custom field of “_stealth-publish” with a value of “1” to indicate posts that are stealth published. Unless, of course, the name of the custom field was changed via use of the ‘c2c_stealth_publish_meta_key’ filter.
Yes.
Highlights:
* This release adds the ability to set the stealth publish checkbox via the quick edit box, adds an icon next to the post date in the admin listing to denote a post has stealth update enabled, adds support for language packs, and has some minor behind-the-scenes changes.
Details:
* New: Add ability to set the Stealth Publish? value in the Quick Edit form.
* Add add_to_submitbox()
, add_to_quick_edit()
, admin_enqueue_scripts()
.
* Add option arg $checked
to add_ui()
and use its value as the default if not null.
* New: Add hidden icon next to post’s date column in posts table to indicate which posts have stealth publish enabled.
* Change: Delete meta key on save if stealth publish is not enabled for post.
* Change: Run esc_attr()
on the field name before display for safety.
* Change: Don’t run esc_attr()
on meta key name as it need not be so restrictive (and isn’t for display).
* Change: Add support for language packs:
* Set textdomain using a string instead of a variable.
* Don’t load textdomain from file.
* Remove ‘Domain Path’ from plugin header.
* Remove .pot file and /lang subdirectory.
* New: Add LICENSE file.
* New: Add empty index.php to prevent files from being listed if web server has enabled directory listings.
* Change: Add docblocks for class variables.
* Change: Add docblock to example code.
* Change: Note compatibility through WP 4.5+.
* Change: Update copyright date (2016).
dirname(__FILE__)
; DIR is only supported in PHP 5.3+dirname(__FILE__)
load_textdomain()