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
028e5edb
Commit
028e5edb
authored
7 years ago
by
dyszczo
Browse files
Options
Downloads
Patches
Plain Diff
rearange methods
parent
97fd491d
No related branches found
No related tags found
2 merge requests
!5
Devel
,
!4
more like builder pattern
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/AbstractPlugin.php
+28
-28
28 additions, 28 deletions
src/Plugin/AbstractPlugin.php
with
28 additions
and
28 deletions
src/Plugin/AbstractPlugin.php
+
28
−
28
View file @
028e5edb
...
@@ -40,27 +40,6 @@ abstract class AbstractPlugin implements \WPDesk_Translable {
...
@@ -40,27 +40,6 @@ abstract class AbstractPlugin implements \WPDesk_Translable {
$this
->
hooks
();
$this
->
hooks
();
}
}
/**
* @return $this
*/
public
function
get_plugin
()
{
return
$this
;
}
/**
* @return string
*/
public
function
get_text_domain
()
{
return
$this
->
plugin_info
->
get_text_domain
();
}
/**
* @return void
*/
public
function
load_plugin_text_domain
()
{
load_plugin_textdomain
(
$this
->
get_text_domain
(),
false
,
$this
->
get_namespace
()
.
'/lang/'
);
}
public
function
init_base_variables
()
{
public
function
init_base_variables
()
{
$this
->
plugin_url
=
plugin_dir_url
(
$this
->
plugin_info
->
get_plugin_dir
()
);
$this
->
plugin_url
=
plugin_dir_url
(
$this
->
plugin_info
->
get_plugin_dir
()
);
}
}
...
@@ -82,22 +61,31 @@ abstract class AbstractPlugin implements \WPDesk_Translable {
...
@@ -82,22 +61,31 @@ abstract class AbstractPlugin implements \WPDesk_Translable {
}
}
/**
/**
*
* @return string
* @return string
*/
*/
public
function
get_plugin_
url
()
{
public
function
get_plugin_
file_path
()
{
return
esc_url
(
trailingslashit
(
$this
->
plugin_
url
)
);
return
$this
->
plugin_info
->
get_
plugin_
dir
(
);
}
}
public
function
get_plugin_assets_url
()
{
/**
return
esc_url
(
trailingslashit
(
$this
->
get_plugin_url
()
.
'assets'
)
);
* @return $this
*/
public
function
get_plugin
()
{
return
$this
;
}
/**
* @return void
*/
public
function
load_plugin_text_domain
()
{
load_plugin_textdomain
(
$this
->
get_text_domain
(),
false
,
$this
->
get_namespace
()
.
'/lang/'
);
}
}
/**
/**
* @return string
* @return string
*/
*/
public
function
get_
plugin_file_path
()
{
public
function
get_
text_domain
()
{
return
$this
->
plugin_info
->
get_
plugin_dir
();
return
$this
->
plugin_info
->
get_
text_domain
();
}
}
/**
/**
...
@@ -107,6 +95,18 @@ abstract class AbstractPlugin implements \WPDesk_Translable {
...
@@ -107,6 +95,18 @@ abstract class AbstractPlugin implements \WPDesk_Translable {
return
$this
->
plugin_namespace
;
return
$this
->
plugin_namespace
;
}
}
public
function
get_plugin_assets_url
()
{
return
esc_url
(
trailingslashit
(
$this
->
get_plugin_url
()
.
'assets'
)
);
}
/**
*
* @return string
*/
public
function
get_plugin_url
()
{
return
esc_url
(
trailingslashit
(
$this
->
plugin_url
)
);
}
public
function
admin_enqueue_scripts
()
{
public
function
admin_enqueue_scripts
()
{
}
}
...
...
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