Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-builder
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-builder
Commits
5e011feb
Commit
5e011feb
authored
2 years ago
by
Piotr Potrebka
Browse files
Options
Downloads
Patches
Plain Diff
fix: script version, docs
parent
0ce715a4
Branches
feat/lang
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!33
feat: plugin path, lang, scripts version
Pipeline
#138983
passed with stages
in 48 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-1
1 addition, 1 deletion
CHANGELOG.md
src/Plugin/AbstractPlugin.php
+13
-9
13 additions, 9 deletions
src/Plugin/AbstractPlugin.php
with
14 additions
and
10 deletions
CHANGELOG.md
+
1
−
1
View file @
5e011feb
## [2.1.0] - 2022-1
1-07
## [2.1.0] - 2022-1
2-15
### Added
-
plugin path
-
plugin lang
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/AbstractPlugin.php
+
13
−
9
View file @
5e011feb
...
...
@@ -156,7 +156,7 @@ abstract class AbstractPlugin extends SlimPlugin {
add_action
(
'admin_enqueue_scripts'
,
[
$this
,
'admin_enqueue_scripts'
]
);
add_action
(
'wp_enqueue_scripts'
,
[
$this
,
'wp_enqueue_scripts'
]
);
add_action
(
'plugins_loaded'
,
[
$this
,
'load_plugin_text_domain'
]
);
add_filter
(
'plugin_action_links_'
.
plugin_basename
(
$this
->
get_plugin_file_path
()
),
[
$this
,
'links_filter'
]
);
add_filter
(
'plugin_action_links_'
.
plugin_basename
(
$this
->
get_plugin_file_path
()
),
[
$this
,
'links_filter'
]
);
}
/**
...
...
@@ -171,9 +171,11 @@ abstract class AbstractPlugin extends SlimPlugin {
/**
* Append JS scripts in the WordPress admin panel. This is a hook function. Do not execute directly.
*
* @param string $hook_suffix The current admin page passed from WordPress filter.
*
* @return void
*/
public
function
admin_enqueue_scripts
(
$hook
=
''
)
{
public
function
admin_enqueue_scripts
(
$hook
_suffix
=
''
)
{
}
/**
...
...
@@ -186,18 +188,20 @@ abstract class AbstractPlugin extends SlimPlugin {
/**
* @param string $prefix
* @param bool $random
*
* @return
int|
string
* @return string
*/
public
function
get_scripts_version
(
$prefix
=
''
,
$random
=
false
)
{
if
(
$random
)
{
return
time
();
}
public
function
get_scripts_version
(
$prefix
=
''
)
{
return
$prefix
.
$this
->
plugin_info
->
get_version
();
}
/**
* @return int
*/
public
function
get_random_script_version
()
{
return
time
();
}
/**
* Initialize plugin admin links. This is a hook function. Do not execute directly.
*
...
...
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