FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
extension-command/extension-command.php at main · wp-cli/extension-command · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
wp-cli
/
extension-command
Public
Notifications
You must be signed in to change notification settings
Fork
87
Star
90
Code
Issues
2
Pull requests
3
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
extension-command
/
extension-command.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (50 loc) · 2.05 KB
Breadcrumbs
extension-command
/
extension-command.php
Copy path
File metadata and controls
58 lines (50 loc) · 2.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
if
( !
class_exists
(
'
WP_CLI
'
) ) {
return
;
}
$
wpcli_extension_autoloader
=
__DIR__
.
'
/vendor/autoload.php
'
;
if
(
file_exists
(
$
wpcli_extension_autoloader
) ) {
require_once
$
wpcli_extension_autoloader
;
}
require_once
__DIR__
.
'
/src/Plugin_Download_Command.php
'
;
require_once
__DIR__
.
'
/src/Theme_Download_Command.php
'
;
$
wpcli_extension_requires_wp_5_5
= [
'
before_invoke
'
=>
static
function
() {
if
(
WP_CLI
\
Utils
\wp_version_compare
(
'
5.5
'
,
'
<
'
) ) {
WP_CLI
::
error
(
'
Requires WordPress 5.5 or greater.
'
);
}
},
];
WP_CLI
::
add_command
(
'
plugin
'
,
'
Plugin_Command
'
);
WP_CLI
::
add_command
(
'
plugin download
'
,
'
Plugin_Download_Command
'
);
WP_CLI
::
add_command
(
'
plugin auto-updates
'
,
'
Plugin_AutoUpdates_Command
'
,
$
wpcli_extension_requires_wp_5_5
);
WP_CLI
::
add_command
(
'
theme
'
,
'
Theme_Command
'
);
WP_CLI
::
add_command
(
'
theme download
'
,
'
Theme_Download_Command
'
);
WP_CLI
::
add_command
(
'
theme auto-updates
'
,
'
Theme_AutoUpdates_Command
'
,
$
wpcli_extension_requires_wp_5_5
);
WP_CLI
::
add_command
(
'
theme mod
'
,
'
Theme_Mod_Command
'
);
// In admin context, WordPress hooks wp_update_plugins/wp_update_themes to
// various actions, causing update checks to run even when --skip-update-check is passed.
WP_CLI
::
add_hook
(
'
before_wp_load
'
,
static
function
() {
if
( !
\
WP_CLI
\
Utils
\get_flag_value
(
WP_CLI
::
get_runner
()->
assoc_args
,
'
skip-update-check
'
) ) {
return
;
}
WP_CLI
::
add_wp_hook
(
'
wp_loaded
'
,
static
function
() {
remove_action
(
'
load-plugins.php
'
,
'
wp_update_plugins
'
);
remove_action
(
'
load-update.php
'
,
'
wp_update_plugins
'
);
remove_action
(
'
load-update-core.php
'
,
'
wp_update_plugins
'
);
remove_action
(
'
admin_init
'
,
'
_maybe_update_plugins
'
);
remove_action
(
'
wp_update_plugins
'
,
'
wp_update_plugins
'
);
remove_action
(
'
load-themes.php
'
,
'
wp_update_themes
'
);
remove_action
(
'
load-update.php
'
,
'
wp_update_themes
'
);
remove_action
(
'
load-update-core.php
'
,
'
wp_update_themes
'
);
remove_action
(
'
admin_init
'
,
'
_maybe_update_themes
'
);
remove_action
(
'
wp_update_themes
'
,
'
wp_update_themes
'
);
},
PHP_INT_MIN
);
}
);
Back
|
FazBrowse Home
|
New Git URL