Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-basic-requirements
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-basic-requirements
Commits
332e689a
Commit
332e689a
authored
6 years ago
by
dyszczo
Browse files
Options
Downloads
Patches
Plain Diff
requirement class can render or disable
parent
57d76f5a
No related branches found
No related tags found
2 merge requests
!8
Devel
,
!7
requirement class can render or disable
Pipeline
#8234
failed
6 years ago
Stage: tools
Stage: tests
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Basic_Requirement_Checker.php
+35
-2
35 additions, 2 deletions
src/Basic_Requirement_Checker.php
with
35 additions
and
2 deletions
src/Basic_Requirement_Checker.php
+
35
−
2
View file @
332e689a
...
@@ -340,18 +340,51 @@ class WPDesk_Basic_Requirement_Checker implements WPDesk_Translable {
...
@@ -340,18 +340,51 @@ class WPDesk_Basic_Requirement_Checker implements WPDesk_Translable {
* @return bool
* @return bool
*/
*/
public
static
function
is_setting_set
(
$name
,
$value
)
{
public
static
function
is_setting_set
(
$name
,
$value
)
{
return
ini_get
(
$name
)
===
str
val
(
$value
)
;
return
ini_get
(
$name
)
===
(
str
ing
)
$value
;
}
}
/**
/**
* @return void
* @return void
*
* @deprecated use render_notices or disable_plugin
*/
*/
public
function
disable_plugin_render_notice
()
{
public
function
disable_plugin_render_notice
()
{
add_action
(
self
::
HOOK_ADMIN_NOTICES_ACTION
,
array
(
$this
,
'render_notices_action'
)
);
add_action
(
self
::
HOOK_ADMIN_NOTICES_ACTION
,
array
(
$this
,
'render_notices_action'
)
);
}
}
/**
/**
* Shoud be called as WordPress action
* Renders requirement notices in admin panel
*
* @return void
*/
public
function
render_notices
()
{
add_action
(
self
::
HOOK_ADMIN_NOTICES_ACTION
,
array
(
$this
,
'render_notices_action'
)
);
}
/**
* Renders requirement notices in admin panel
*
* @return void
*/
public
function
disable_plugin
()
{
add_action
(
self
::
HOOK_ADMIN_NOTICES_ACTION
,
array
(
$this
,
'deactivate_action'
)
);
}
/**
* @internal Do not use as public. Public only for wp action.
*
* @return void
*/
public
function
deactivate_action
()
{
if
(
isset
(
$this
->
plugin_file
)
)
{
deactivate_plugins
(
plugin_basename
(
$this
->
plugin_file
)
);
}
}
/**
* Should be called as WordPress action
*
* @internal Do not use as public. Public only for wp action.
*
*
* @return void
* @return void
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment