Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-builder
Commits
193b8fcd
Commit
193b8fcd
authored
6 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
added method: get_hookable_instance_by_class_name
parent
1d98f903
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!15
added method: get_hookable_instance_by_class_name
Pipeline
#7540
failed
6 years ago
Stage: tools
Stage: tests
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/HookableParent.php
+16
-0
16 additions, 0 deletions
src/Plugin/HookableParent.php
with
16 additions
and
0 deletions
src/Plugin/HookableParent.php
+
16
−
0
View file @
193b8fcd
...
@@ -23,6 +23,22 @@ trait HookableParent {
...
@@ -23,6 +23,22 @@ trait HookableParent {
$this
->
hookable_objects
[]
=
$hookable_object
;
$this
->
hookable_objects
[]
=
$hookable_object
;
}
}
/**
* Get hookable instance.
*
* @param string $class_name Class name.
*
* @return false|Hookable
*/
public
function
get_hookable_instance_by_class_name
(
$class_name
)
{
foreach
(
$this
->
hookable_objects
as
$hookable_object
)
{
if
(
$hookable_object
instanceof
$class_name
)
{
return
$hookable_object
;
}
}
return
false
;
}
/**
/**
* Run hooks method on all hookable objects.
* Run hooks method on all hookable objects.
*/
*/
...
...
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