Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Remove constants from the feature plugin #112

Merged
merged 2 commits into from
May 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 4 additions & 27 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,12 @@ function wp_autoupdates_prepare_themes_for_js( $prepared_themes ) {
* @return bool True if plugins auto-update is enabled, false otherwise.
*/
function wp_autoupdates_is_plugins_auto_update_enabled() {
$enabled = ! defined( 'WP_DISABLE_PLUGINS_AUTO_UPDATE' ) || ! WP_DISABLE_PLUGINS_AUTO_UPDATE;

/**
* Filters whether plugins manual auto-update is enabled.
*
* @param bool $enabled True if plugins auto-update is enabled, false otherwise.
*/
return apply_filters( 'wp_plugins_auto_update_enabled', $enabled );
return apply_filters( 'wp_plugins_auto_update_enabled', true );
}


Expand All @@ -186,14 +184,12 @@ function wp_autoupdates_is_plugins_auto_update_enabled() {
* @return bool True if themes auto-update is enabled, false otherwise.
*/
function wp_autoupdates_is_themes_auto_update_enabled() {
$enabled = ! defined( 'WP_DISABLE_THEMES_AUTO_UPDATE' ) || ! WP_DISABLE_THEMES_AUTO_UPDATE;

/**
* Filters whether themes manual auto-update is enabled.
*
* @param bool $enabled True if themes auto-update is enabled, false otherwise.
*/
return apply_filters( 'wp_themes_auto_update_enabled', $enabled );
return apply_filters( 'wp_themes_auto_update_enabled', true );
}


Expand Down Expand Up @@ -909,21 +905,6 @@ function wp_autoupdates_debug_information( $info ) {
}
}

// Populate constants informations.
$plugins_enabled = defined( 'WP_DISABLE_PLUGINS_AUTO_UPDATE' ) ? WP_DISABLE_PLUGINS_AUTO_UPDATE : __( 'Undefined', 'wp-autoupdates' );
$info['wp-constants']['fields']['WP_DISABLE_PLUGINS_AUTO_UPDATE'] = array(
'label' => 'WP_DISABLE_PLUGINS_AUTO_UPDATE',
'value' => $plugins_enabled,
'debug' => strtolower( $plugins_enabled ),
);

$themes_enabled = defined( 'WP_DISABLE_THEMES_AUTO_UPDATE' ) ? WP_DISABLE_THEMES_AUTO_UPDATE : __( 'Undefined', 'wp-autoupdates' );
$info['wp-constants']['fields']['WP_DISABLE_THEMES_AUTO_UPDATE'] = array(
'label' => 'WP_DISABLE_THEMES_AUTO_UPDATE',
'value' => $themes_enabled,
'debug' => strtolower( $themes_enabled ),
);

return $info;
}
add_filter( 'debug_information', 'wp_autoupdates_debug_information' );
Expand All @@ -935,14 +916,12 @@ function wp_autoupdates_debug_information( $info ) {
* @return bool True if plugins notifications are enabled, false otherwise.
*/
function wp_autoupdates_is_plugins_auto_update_email_enabled() {
$enabled = ! defined( 'WP_DISABLE_PLUGINS_AUTO_UPDATE_EMAIL' ) || ! WP_DISABLE_PLUGINS_AUTO_UPDATE;

/**
* Filters whether plugins auto-update email notifications are enabled.
*
* @param bool $enabled True if plugins notifications are enabled, false otherwise.
*/
return apply_filters( 'send_plugins_auto_update_email', $enabled );
return apply_filters( 'send_plugins_auto_update_email', true );
}


Expand All @@ -952,14 +931,12 @@ function wp_autoupdates_is_plugins_auto_update_email_enabled() {
* @return bool True if themes notifications are enabled, false otherwise.
*/
function wp_autoupdates_is_themes_auto_update_email_enabled() {
$enabled = ! defined( 'WP_DISABLE_THEMES_AUTO_UPDATE_EMAIL' ) || ! WP_DISABLE_THEMES_AUTO_UPDATE;

/**
* Filters whether themes auto-update email notifications are enabled.
*
* @param bool $enabled True if themes notifications are enabled, false otherwise.
*/
return apply_filters( 'send_themes_auto_update_email', $enabled );
return apply_filters( 'send_themes_auto_update_email', true );
}


Expand Down