当サイト、Codex 日本語版は今後積極的な更新は行わない予定です。後継となる新ユーザーマニュアルは、https://ja.wordpress.org/support/ にあります。
万が一、当サイトで重大な問題を発見した際などは、フォーラムWordSlack #docs チャンネルでお知らせください。</p>

「自動バックグラウンド更新の設定」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(2013-10-24T19:35:47 Mamun155 版から新規作成)
 
(相違点なし)

2013年10月25日 (金) 11:00時点における版

このページ「自動バックグラウンド更新の設定」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

Automatic background updates were introduced in WordPress 3.7 in an effort to promote better security, and to streamline the update experience overall. By default, only minor releases – such as for maintenance and security purposes – and translation file updates are enabled.

WordPress には4種類の自動更新機能があります。

  1. コアファイル更新
  2. プラグイン更新
  3. テーマ更新
  4. 翻訳ファイル更新

コアの更新

Core updates are subdivided into three types:

  1. Core development updates, known as the "bleeding edge"
  2. Minor core updates, such as maintenance and security releases
  3. Major core release updates

By default, automatic updates are only enabled for minor core releases and translation files.

WP_AUTO_UPDATE_CORE

To enable automatic updates for major releases or development purposes, the place to start is with the WP_AUTO_UPDATE_CORE constant. Defining this constant one of three ways allows you to blanket-enable, or blanket-disable several types of core updates at once.

WP_AUTO_UPDATE_CORE can be defined with one of three values, each producing a different behavior:

  • Value of true – Development, minor, and major updates are all enabled
  • Value of false – Development, minor, and major updates are all disabled
  • Value of minor – Minor updates are enabled, development, and major updates are disabled

微調整用のフィルタ

But let's say rather than enabling or disabling all three types of core updates, you want to selectively enable or disable them. That's where the allow_dev_auto_core_updates, allow_minor_auto_core_updates, and allow_major_auto_core_updates filters come in.

There are two shorthand functions built into WordPress that will allow you to enable or disable specific types of core updates with single lines of code. They are __return_true and __return_false. Here are some example filters:

To specifically enable development (nightly) updates, use the following:

add_filter( 'allow_dev_auto_core_updates', '__return_true' );

To specifically disable minor updates, use the following:

add_filter( 'allow_minor_auto_core_updates', '__return_false' );

To specifically enable major updates, use the following:

add_filter( 'allow_major_auto_core_updates', '__return_true' );

プラグイン&テーマ更新

Automatic plugin and theme updates are disabled by default. To enable them, you can leverage the auto_update_$type filter, where $type would be replaced with "plugin" or "theme".

To enable automatic updates for plugins, use the following:

add_filter( 'auto_update_plugin', '__return_true' );

To enable automatic updates for themes, use the following:

add_filter( 'auto_update_theme', '__return_true' );

翻訳の更新

Automatic translation file updates are already enabled by default, the same as minor core updates.

To disable translation file updates, use the following:

add_filter( 'auto_update_translation', '__return_false' );

自動更新を無効にする

The core developers made a conscious decision to enable automatic updates for minor releases and translation files out of the box. Going forward, this will be one of the best ways to guarantee your site stays up to date and secure and, as such, disabling these updates is strongly discouraged.

コアファイル更新

You can specifically disable all core-type updates by leveraging the auto_update_$type filter, where $type would be replaced with "core".

To disable all core-type updates only, use the following:

add_filter( 'auto_update_core', '__return_false' );

すべての更新

To completely disable all types of automatic updates, core or otherwise, add the following to your wp-config.php file:

define( 'AUTOMATIC_UPDATER_DISABLED', true );

To be safe, you should also add the following to a custom plugin or your theme's functions.php file:

add_filter( 'automatic_updater_disabled', '__return_true' );

最新英語版: WordPress Codex » Configuring Automatic Background Updates最新版との差分