Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
noblogs-wp
Commits
fa43eddd
Commit
fa43eddd
authored
Apr 19, 2017
by
lucha
Committed by
agata
Oct 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patched Disable Updates to run checks during cron jobs
parent
7695fa80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
wp-content/mu-plugins/disable-updates.php
wp-content/mu-plugins/disable-updates.php
+12
-9
No files found.
wp-content/mu-plugins/disable-updates.php
View file @
fa43eddd
...
@@ -59,6 +59,8 @@ class OS_Disable_WordPress_Updates {
...
@@ -59,6 +59,8 @@ class OS_Disable_WordPress_Updates {
* @author scripts@schloebe.de
* @author scripts@schloebe.de
*/
*/
function
__construct
()
{
function
__construct
()
{
if
(
!
defined
(
'AI_CRON_SCRIPT'
))
{
add_action
(
'admin_init'
,
array
(
&
$this
,
'admin_init'
)
);
add_action
(
'admin_init'
,
array
(
&
$this
,
'admin_init'
)
);
/*
/*
...
@@ -92,8 +94,8 @@ class OS_Disable_WordPress_Updates {
...
@@ -92,8 +94,8 @@ class OS_Disable_WordPress_Updates {
* 3.0
* 3.0
*/
*/
add_filter
(
'pre_site_transient_update_core'
,
array
(
$this
,
'last_checked_atm'
)
);
add_filter
(
'pre_site_transient_update_core'
,
array
(
$this
,
'last_checked_atm'
)
);
/*
/*
* Filter schedule checks
* Filter schedule checks
*
*
...
@@ -129,6 +131,7 @@ class OS_Disable_WordPress_Updates {
...
@@ -129,6 +131,7 @@ class OS_Disable_WordPress_Updates {
if
(
!
defined
(
'WP_AUTO_UPDATE_CORE'
)
)
define
(
'WP_AUTO_UPDATE_CORE'
,
false
);
if
(
!
defined
(
'WP_AUTO_UPDATE_CORE'
)
)
define
(
'WP_AUTO_UPDATE_CORE'
,
false
);
add_filter
(
'pre_http_request'
,
array
(
$this
,
'block_request'
),
10
,
3
);
add_filter
(
'pre_http_request'
,
array
(
$this
,
'block_request'
),
10
,
3
);
}
}
}
...
@@ -140,13 +143,13 @@ class OS_Disable_WordPress_Updates {
...
@@ -140,13 +143,13 @@ class OS_Disable_WordPress_Updates {
*/
*/
function
admin_init
()
{
function
admin_init
()
{
if
(
!
function_exists
(
"remove_action"
)
)
return
;
if
(
!
function_exists
(
"remove_action"
)
)
return
;
/*
/*
* Remove 'update plugins' option from bulk operations select list
* Remove 'update plugins' option from bulk operations select list
*/
*/
global
$current_user
;
global
$current_user
;
$current_user
->
allcaps
[
'update_plugins'
]
=
0
;
$current_user
->
allcaps
[
'update_plugins'
]
=
0
;
/*
/*
* Hide maintenance and update nag
* Hide maintenance and update nag
*/
*/
...
@@ -154,7 +157,7 @@ class OS_Disable_WordPress_Updates {
...
@@ -154,7 +157,7 @@ class OS_Disable_WordPress_Updates {
remove_action
(
'network_admin_notices'
,
'update_nag'
,
3
);
remove_action
(
'network_admin_notices'
,
'update_nag'
,
3
);
remove_action
(
'admin_notices'
,
'maintenance_nag'
);
remove_action
(
'admin_notices'
,
'maintenance_nag'
);
remove_action
(
'network_admin_notices'
,
'maintenance_nag'
);
remove_action
(
'network_admin_notices'
,
'maintenance_nag'
);
/*
/*
* Disable Theme Updates
* Disable Theme Updates
...
@@ -263,8 +266,8 @@ class OS_Disable_WordPress_Updates {
...
@@ -263,8 +266,8 @@ class OS_Disable_WordPress_Updates {
}
}
return
$event
;
return
$event
;
}
}
/**
/**
* Override version check info
* Override version check info
*
*
...
@@ -272,12 +275,12 @@ class OS_Disable_WordPress_Updates {
...
@@ -272,12 +275,12 @@ class OS_Disable_WordPress_Updates {
*/
*/
public
function
last_checked_atm
(
$t
)
{
public
function
last_checked_atm
(
$t
)
{
include
(
ABSPATH
.
WPINC
.
'/version.php'
);
include
(
ABSPATH
.
WPINC
.
'/version.php'
);
$current
=
new
stdClass
;
$current
=
new
stdClass
;
$current
->
updates
=
array
();
$current
->
updates
=
array
();
$current
->
version_checked
=
$wp_version
;
$current
->
version_checked
=
$wp_version
;
$current
->
last_checked
=
time
();
$current
->
last_checked
=
time
();
return
$current
;
return
$current
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment