{"id":156465,"date":"2010-09-09T08:00:00","date_gmt":"2010-09-09T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/silent-publish\/"},"modified":"2020-02-14T15:56:00","modified_gmt":"2020-02-14T15:56:00","slug":"silent-publish","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/silent-publish\/","title":{"rendered":"Silent Publish"},"content":{"rendered":"<p>This plugin gives you the ability to publish a post without triggering pingbacks, trackbacks, or notifying update services.<\/p>\n<p>A \u201cPublish silently?\u201d checkbox is added to the \u201cAdd New Post\u201d and \u201cEdit Post\u201d admin pages (the latter only for unpublished posts). If checked when the post is published, that post will not trigger the pingbacks, trackbacks, and update service notifications that would typically occur.<\/p>\n<p>In every other manner, the post is published as usual: it\u2019ll appear on the front page, archives, and feeds as expected, and no other aspect of the post is affected.<\/p>\n<p>While trackbacks and pingsbacks can already be disabled from the Add New Post\/Page page, this plugin makes things easier by allowing a single checkbox to disable those things, in addition to disabling notification of update services which otherwise could only be disabled by clearing the value of the global setting, which would then affect all authors and any subsequently published posts.<\/p>\n<p>If a post is silently published, a custom field \u2018_silent-publish\u2019 for the post is set to a value of 1 as a means of recording the action. However, this value is not used after publish for any purpose as of yet. Nor is the custom field unset or changed if the post is later re-published.<\/p>\n<p>Also see my <a href=\"https:\/\/wordpress.org\/plugins\/stealth-publish\/\" rel=\"ugc\">Stealth Publish<\/a> plugin if you want to make a new post but prevent it from appearing on the front page of your blog and in feeds. (That plugin incorporates this plugin\u2019s functionality, so you won\u2019t need both.)<\/p>\n<p>Links: <a href=\"http:\/\/coffee2code.com\/wp-plugins\/silent-publish\/\" rel=\"nofollow ugc\">Plugin Homepage<\/a> | <a href=\"https:\/\/wordpress.org\/plugins\/silent-publish\/\" rel=\"ugc\">Plugin Directory Page<\/a> | <a href=\"https:\/\/github.com\/coffee2code\/silent-publish\/\" rel=\"nofollow ugc\">GitHub<\/a> | <a href=\"http:\/\/coffee2code.com\" rel=\"nofollow ugc\">Author Homepage<\/a><\/p>\n<h3>Hooks<\/h3>\n<p>The plugin is further customizable via three filters. Code using these filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain). Less ideally, you could put them in your active theme\u2019s functions.php file.<\/p>\n<p><strong>c2c_silent_publish_meta_key (filter)<\/strong><\/p>\n<p>The \u2018c2c_silent_publish_meta_key\u2019 filter allows you to override the name of the custom field key used by the plugin to store a post\u2019s silent publish status. This isn\u2019t a common need.<\/p>\n<p>Arguments:<\/p>\n<ul>\n<li>$custom_field_key (string): The custom field key to be used by the plugin. By default this is \u2018_silent-publish\u2019.<\/li>\n<\/ul>\n<p>Example:<\/p>\n<pre><code>\/**\n * Defines a custom meta key to be used by Silent Publish.\n *\n * @param string $custom_field_key The default custom field key name.\n * @return string\n *\/\nfunction override_silent_publish_key( $custom_field_key ) {\n    return '_my_custom_silent-publish';\n}\nadd_filter( 'c2c_silent_publish_meta_key', 'override_silent_publish_key' );\n<\/code><\/pre>\n<p><strong>c2c_silent_publish_default (filter)<\/strong><\/p>\n<p>The \u2018c2c_silent_publish_default\u2019 filter allows you to override the default state of the \u2018Silent Publish?\u2019 checkbox.<\/p>\n<p>Arguments:<\/p>\n<ul>\n<li>$state (boolean): The default state of the checkbox. By default this is false.<\/li>\n<li>$post (WP_Post): The post currently being created\/edited.<\/li>\n<\/ul>\n<p>Example:<\/p>\n<pre><code>\/\/ Have the Silent Publish? checkbox checked by default.\nadd_filter( 'c2c_silent_publish_default', '__return_true' );\n<\/code><\/pre>\n<p><strong>c2c_silent_publish_post_types (filter)<\/strong><\/p>\n<p>The \u2018c2c_silent_publish_post_types\u2019 filter allows you to override the post types that can be silently published.<\/p>\n<p>Arguments:<\/p>\n<ul>\n<li>$post_types (array): Array of post type names.<\/li>\n<\/ul>\n<p>Example:<\/p>\n<pre><code>\/**\n * Disable Silent Publish for a custom public post type 'book'.\n *\n * @param array $post_types Array of post type names.\n * @return array\n *\/\nfunction my_c2c_silent_publish_post_types( $post_types ) {\n    $post_types = array_flip( $post_types );\n    unset( $post_types[ 'book' ] );\n    return array_keys( $post_types ).\n}\nadd_filter( 'c2c_silent_publish_post_types', 'my_c2c_silent_publish_post_types' );\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Adds the ability to publish a post without triggering pingbacks, trackbacks, or notifying update services.<\/p>\n","protected":false},"author":65,"featured_media":342789,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Silent Publish - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Adds the ability to publish a post without triggering pingbacks, trackbacks, or notifying update services."},"footnotes":""},"categories":[1],"tags":[41029,1611,2003,4248,41030],"class_list":["post-156465","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-no-ping","tag-ping","tag-publish","tag-trackback","tag-update-services"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/156465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=156465"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/156465\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/342789"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=156465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=156465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=156465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}