Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-notice
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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-notice
Commits
828b6075
Commit
828b6075
authored
6 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
Changed functions names.
parent
fc14bd7d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!14
Changed functions names.
Pipeline
#9788
passed with stages
in 2 minutes and 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-2
2 additions, 2 deletions
README.md
src/WPDesk/notice-functions.php
+35
-35
35 additions, 35 deletions
src/WPDesk/notice-functions.php
tests/integration/TestFunctions.php
+20
-20
20 additions, 20 deletions
tests/integration/TestFunctions.php
with
57 additions
and
57 deletions
README.md
+
2
−
2
View file @
828b6075
...
@@ -45,10 +45,10 @@ require_once('/path/to/wp-desk/wp-notice/init.php');
...
@@ -45,10 +45,10 @@ require_once('/path/to/wp-desk/wp-notice/init.php');
Simple usage looks like:
Simple usage looks like:
```
php
```
php
$notice
=
wpdesk_notice
(
'Notice text goes here'
);
$notice
=
wpdesk_
wp_
notice
(
'Notice text goes here'
);
// Is equivalent to:
// Is equivalent to:
$notice
=
WPDeskNotice
(
'Notice text goes here'
);
$notice
=
WPDesk
Wp
Notice
(
'Notice text goes here'
);
// Is equivalent to:
// Is equivalent to:
$notice
=
\WPDesk\Notice\Factory
::
notice
(
'Notice text goes here'
);
$notice
=
\WPDesk\Notice\Factory
::
notice
(
'Notice text goes here'
);
...
...
This diff is collapsed.
Click to expand it.
src/WPDesk/notice-functions.php
+
35
−
35
View file @
828b6075
<?php
<?php
if
(
!
function_exists
(
'WPDeskInitNoticeAjaxHandler'
))
{
if
(
!
function_exists
(
'WPDeskInit
Wp
NoticeAjaxHandler'
))
{
/**
/**
* Init notices AJAX Handler.
* Init notices AJAX Handler.
*
*
...
@@ -8,7 +8,7 @@ if (!function_exists('WPDeskInitNoticeAjaxHandler')) {
...
@@ -8,7 +8,7 @@ if (!function_exists('WPDeskInitNoticeAjaxHandler')) {
*
*
* @return \WPDesk\Notice\AjaxHandler
* @return \WPDesk\Notice\AjaxHandler
*/
*/
function
WPDeskInitNoticeAjaxHandler
(
$assetsUrl
=
null
)
function
WPDeskInit
Wp
NoticeAjaxHandler
(
$assetsUrl
=
null
)
{
{
$ajax_handler
=
new
\WPDesk\Notice\AjaxHandler
(
$assetsUrl
);
$ajax_handler
=
new
\WPDesk\Notice\AjaxHandler
(
$assetsUrl
);
$ajax_handler
->
hooks
();
$ajax_handler
->
hooks
();
...
@@ -16,7 +16,7 @@ if (!function_exists('WPDeskInitNoticeAjaxHandler')) {
...
@@ -16,7 +16,7 @@ if (!function_exists('WPDeskInitNoticeAjaxHandler')) {
}
}
}
}
if
(
!
function_exists
(
'wpdesk_init_notice_ajax_handler'
))
{
if
(
!
function_exists
(
'wpdesk_init_
wp_
notice_ajax_handler'
))
{
/**
/**
* Alias for {@see WPDeskInitNoticeAjaxHandler()} function.
* Alias for {@see WPDeskInitNoticeAjaxHandler()} function.
*
*
...
@@ -24,13 +24,13 @@ if (!function_exists('wpdesk_init_notice_ajax_handler')) {
...
@@ -24,13 +24,13 @@ if (!function_exists('wpdesk_init_notice_ajax_handler')) {
*
*
* @return \WPDesk\Notice\AjaxHandler
* @return \WPDesk\Notice\AjaxHandler
*/
*/
function
wpdesk_init_notice_ajax_handler
(
$assetsUrl
=
null
)
function
wpdesk_init_
wp_
notice_ajax_handler
(
$assetsUrl
=
null
)
{
{
return
WPDeskInitNoticeAjaxHandler
(
$assetsUrl
);
return
WPDeskInit
Wp
NoticeAjaxHandler
(
$assetsUrl
);
}
}
}
}
if
(
!
function_exists
(
'WPDeskNotice'
))
{
if
(
!
function_exists
(
'WPDesk
Wp
Notice'
))
{
/**
/**
* Creates Notice.
* Creates Notice.
*
*
...
@@ -41,13 +41,13 @@ if (!function_exists('WPDeskNotice')) {
...
@@ -41,13 +41,13 @@ if (!function_exists('WPDeskNotice')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
WPDeskNotice
(
$noticeContent
,
$noticeType
=
'info'
,
$dismissible
=
false
,
$priority
=
10
)
function
WPDesk
Wp
Notice
(
$noticeContent
,
$noticeType
=
'info'
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
\WPDesk\Notice\Factory
::
notice
(
$noticeContent
,
$noticeType
,
$dismissible
,
$priority
);
return
\WPDesk\Notice\Factory
::
notice
(
$noticeContent
,
$noticeType
,
$dismissible
,
$priority
);
}
}
}
}
if
(
!
function_exists
(
'wpdesk_notice'
))
{
if
(
!
function_exists
(
'wpdesk_
wp_
notice'
))
{
/**
/**
* Creates Notice.
* Creates Notice.
*
*
...
@@ -60,13 +60,13 @@ if (!function_exists('wpdesk_notice')) {
...
@@ -60,13 +60,13 @@ if (!function_exists('wpdesk_notice')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
wpdesk_notice
(
$noticeContent
,
$noticeType
=
'info'
,
$dismissible
=
false
,
$priority
=
10
)
function
wpdesk_
wp_
notice
(
$noticeContent
,
$noticeType
=
'info'
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
WPDeskNotice
(
$noticeContent
,
$noticeType
,
$dismissible
,
$priority
);
return
WPDesk
Wp
Notice
(
$noticeContent
,
$noticeType
,
$dismissible
,
$priority
);
}
}
}
}
if
(
!
function_exists
(
'WPDeskNoticeInfo'
))
{
if
(
!
function_exists
(
'WPDesk
Wp
NoticeInfo'
))
{
/**
/**
* Creates Notice Info.
* Creates Notice Info.
*
*
...
@@ -76,7 +76,7 @@ if (!function_exists('WPDeskNoticeInfo')) {
...
@@ -76,7 +76,7 @@ if (!function_exists('WPDeskNoticeInfo')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
WPDeskNoticeInfo
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
WPDesk
Wp
NoticeInfo
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
\WPDesk\Notice\Factory
::
notice
(
return
\WPDesk\Notice\Factory
::
notice
(
$noticeContent
,
$noticeContent
,
...
@@ -87,7 +87,7 @@ if (!function_exists('WPDeskNoticeInfo')) {
...
@@ -87,7 +87,7 @@ if (!function_exists('WPDeskNoticeInfo')) {
}
}
}
}
if
(
!
function_exists
(
'wpdesk_notice_info'
))
{
if
(
!
function_exists
(
'wpdesk_
wp_
notice_info'
))
{
/**
/**
* Creates Notice Info.
* Creates Notice Info.
*
*
...
@@ -99,13 +99,13 @@ if (!function_exists('wpdesk_notice_info')) {
...
@@ -99,13 +99,13 @@ if (!function_exists('wpdesk_notice_info')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
wpdesk_notice_info
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
wpdesk_
wp_
notice_info
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
WPDeskNoticeInfo
(
$noticeContent
,
$dismissible
,
$priority
);
return
WPDesk
Wp
NoticeInfo
(
$noticeContent
,
$dismissible
,
$priority
);
}
}
}
}
if
(
!
function_exists
(
'WPDeskNoticeError'
))
{
if
(
!
function_exists
(
'WPDesk
Wp
NoticeError'
))
{
/**
/**
* Creates Notice Error.
* Creates Notice Error.
*
*
...
@@ -115,7 +115,7 @@ if (!function_exists('WPDeskNoticeError')) {
...
@@ -115,7 +115,7 @@ if (!function_exists('WPDeskNoticeError')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
WPDeskNoticeError
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
WPDesk
Wp
NoticeError
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
\WPDesk\Notice\Factory
::
notice
(
return
\WPDesk\Notice\Factory
::
notice
(
$noticeContent
,
$noticeContent
,
...
@@ -126,7 +126,7 @@ if (!function_exists('WPDeskNoticeError')) {
...
@@ -126,7 +126,7 @@ if (!function_exists('WPDeskNoticeError')) {
}
}
}
}
if
(
!
function_exists
(
'wpdesk_notice_error'
))
{
if
(
!
function_exists
(
'wpdesk_
wp_
notice_error'
))
{
/**
/**
* Creates Notice Error.
* Creates Notice Error.
*
*
...
@@ -138,13 +138,13 @@ if (!function_exists('wpdesk_notice_error')) {
...
@@ -138,13 +138,13 @@ if (!function_exists('wpdesk_notice_error')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
wpdesk_notice_error
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
wpdesk_
wp_
notice_error
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
WPDeskNoticeError
(
$noticeContent
,
$dismissible
,
$priority
);
return
WPDesk
Wp
NoticeError
(
$noticeContent
,
$dismissible
,
$priority
);
}
}
}
}
if
(
!
function_exists
(
'WPDeskNoticeWarning'
))
{
if
(
!
function_exists
(
'WPDesk
Wp
NoticeWarning'
))
{
/**
/**
* Creates Notice Warning.
* Creates Notice Warning.
*
*
...
@@ -154,7 +154,7 @@ if (!function_exists('WPDeskNoticeWarning')) {
...
@@ -154,7 +154,7 @@ if (!function_exists('WPDeskNoticeWarning')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
WPDeskNoticeWarning
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
WPDesk
Wp
NoticeWarning
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
\WPDesk\Notice\Factory
::
notice
(
return
\WPDesk\Notice\Factory
::
notice
(
$noticeContent
,
$noticeContent
,
...
@@ -165,7 +165,7 @@ if (!function_exists('WPDeskNoticeWarning')) {
...
@@ -165,7 +165,7 @@ if (!function_exists('WPDeskNoticeWarning')) {
}
}
}
}
if
(
!
function_exists
(
'wpdesk_notice_warning'
))
{
if
(
!
function_exists
(
'wpdesk_
wp_
notice_warning'
))
{
/**
/**
* Creates Notice Warning.
* Creates Notice Warning.
*
*
...
@@ -177,13 +177,13 @@ if (!function_exists('wpdesk_notice_warning')) {
...
@@ -177,13 +177,13 @@ if (!function_exists('wpdesk_notice_warning')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
wpdesk_notice_warning
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
wpdesk_
wp_
notice_warning
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
WPDeskNoticeWarning
(
$noticeContent
,
$dismissible
,
$priority
);
return
WPDesk
Wp
NoticeWarning
(
$noticeContent
,
$dismissible
,
$priority
);
}
}
}
}
if
(
!
function_exists
(
'WPDeskNoticeSuccess'
))
{
if
(
!
function_exists
(
'WPDesk
Wp
NoticeSuccess'
))
{
/**
/**
* Creates Notice Success.
* Creates Notice Success.
*
*
...
@@ -193,7 +193,7 @@ if (!function_exists('WPDeskNoticeSuccess')) {
...
@@ -193,7 +193,7 @@ if (!function_exists('WPDeskNoticeSuccess')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
WPDeskNoticeSuccess
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
WPDesk
Wp
NoticeSuccess
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
\WPDesk\Notice\Factory
::
notice
(
return
\WPDesk\Notice\Factory
::
notice
(
$noticeContent
,
$noticeContent
,
...
@@ -204,7 +204,7 @@ if (!function_exists('WPDeskNoticeSuccess')) {
...
@@ -204,7 +204,7 @@ if (!function_exists('WPDeskNoticeSuccess')) {
}
}
}
}
if
(
!
function_exists
(
'wpdesk_notice_success'
))
{
if
(
!
function_exists
(
'wpdesk_
wp_
notice_success'
))
{
/**
/**
* Creates Notice Success.
* Creates Notice Success.
*
*
...
@@ -216,13 +216,13 @@ if (!function_exists('wpdesk_notice_success')) {
...
@@ -216,13 +216,13 @@ if (!function_exists('wpdesk_notice_success')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
wpdesk_notice_success
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
function
wpdesk_
wp_
notice_success
(
$noticeContent
,
$dismissible
=
false
,
$priority
=
10
)
{
{
return
WPDeskNoticeSuccess
(
$noticeContent
,
$dismissible
,
$priority
);
return
WPDesk
Wp
NoticeSuccess
(
$noticeContent
,
$dismissible
,
$priority
);
}
}
}
}
if
(
!
function_exists
(
'WPDeskPermanentDismissibleNotice'
))
{
if
(
!
function_exists
(
'WPDeskPermanentDismissible
Wp
Notice'
))
{
/**
/**
* Creates Permanent Dismissible Notice.
* Creates Permanent Dismissible Notice.
*
*
...
@@ -233,7 +233,7 @@ if (!function_exists('WPDeskPermanentDismissibleNotice')) {
...
@@ -233,7 +233,7 @@ if (!function_exists('WPDeskPermanentDismissibleNotice')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
WPDeskPermanentDismissibleNotice
(
$noticeContent
,
$noticeName
,
$noticeType
=
'info'
,
$priority
=
10
)
function
WPDeskPermanentDismissible
Wp
Notice
(
$noticeContent
,
$noticeName
,
$noticeType
=
'info'
,
$priority
=
10
)
{
{
return
\WPDesk\Notice\Factory
::
permanentDismissibleNotice
(
return
\WPDesk\Notice\Factory
::
permanentDismissibleNotice
(
$noticeContent
,
$noticeContent
,
...
@@ -244,7 +244,7 @@ if (!function_exists('WPDeskPermanentDismissibleNotice')) {
...
@@ -244,7 +244,7 @@ if (!function_exists('WPDeskPermanentDismissibleNotice')) {
}
}
}
}
if
(
!
function_exists
(
'wpdesk_permanent_dismissible_notice'
))
{
if
(
!
function_exists
(
'wpdesk_permanent_dismissible_
wp_
notice'
))
{
/**
/**
* Creates Permanent Dismissible Notice.
* Creates Permanent Dismissible Notice.
*
*
...
@@ -257,8 +257,8 @@ if (!function_exists('wpdesk_permanent_dismissible_notice')) {
...
@@ -257,8 +257,8 @@ if (!function_exists('wpdesk_permanent_dismissible_notice')) {
*
*
* @return \WPDesk\Notice\Notice
* @return \WPDesk\Notice\Notice
*/
*/
function
wpdesk_permanent_dismissible_notice
(
$noticeContent
,
$noticeName
,
$noticeType
=
'info'
,
$priority
=
10
)
function
wpdesk_permanent_dismissible_
wp_
notice
(
$noticeContent
,
$noticeName
,
$noticeType
=
'info'
,
$priority
=
10
)
{
{
return
WPDeskPermanentDismissibleNotice
(
$noticeContent
,
$noticeName
,
$noticeType
,
$priority
);
return
WPDeskPermanentDismissible
Wp
Notice
(
$noticeContent
,
$noticeName
,
$noticeType
,
$priority
);
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/integration/TestFunctions.php
+
20
−
20
View file @
828b6075
...
@@ -19,11 +19,11 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -19,11 +19,11 @@ class TestFunctions extends WP_UnitTestCase
}
}
/**
/**
* Test WPDeskNotice function.
* Test WPDesk
Wp
Notice function.
*/
*/
public
function
testWPDeskNotice
()
public
function
testWPDesk
Wp
Notice
()
{
{
$notice
=
wpdesk_notice
(
'test function'
);
$notice
=
wpdesk_
wp_
notice
(
'test function'
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
...
@@ -33,11 +33,11 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -33,11 +33,11 @@ class TestFunctions extends WP_UnitTestCase
}
}
/**
/**
* Test WPDeskNoticeInfo function.
* Test WPDesk
Wp
NoticeInfo function.
*/
*/
public
function
testWPDeskNoticeInfo
()
public
function
testWPDesk
Wp
NoticeInfo
()
{
{
$notice
=
wpdesk_notice_info
(
'test function'
);
$notice
=
wpdesk_
wp_
notice_info
(
'test function'
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
...
@@ -47,11 +47,11 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -47,11 +47,11 @@ class TestFunctions extends WP_UnitTestCase
}
}
/**
/**
* Test WPDeskNoticeError function.
* Test WPDesk
Wp
NoticeError function.
*/
*/
public
function
testWPDeskNoticeError
()
public
function
testWPDesk
Wp
NoticeError
()
{
{
$notice
=
wpdesk_notice_error
(
'test function'
);
$notice
=
wpdesk_
wp_
notice_error
(
'test function'
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
...
@@ -61,11 +61,11 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -61,11 +61,11 @@ class TestFunctions extends WP_UnitTestCase
}
}
/**
/**
* Test WPDeskNoticeWarning function.
* Test WPDesk
Wp
NoticeWarning function.
*/
*/
public
function
testWPDeskNoticeWarning
()
public
function
testWPDesk
Wp
NoticeWarning
()
{
{
$notice
=
wpdesk_notice_warning
(
'test function'
);
$notice
=
wpdesk_
wp_
notice_warning
(
'test function'
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
...
@@ -75,11 +75,11 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -75,11 +75,11 @@ class TestFunctions extends WP_UnitTestCase
}
}
/**
/**
* Test WPDeskNoticeSuccess function.
* Test WPDesk
Wp
NoticeSuccess function.
*/
*/
public
function
testWPDeskNoticeSuccess
()
public
function
testWPDesk
Wp
NoticeSuccess
()
{
{
$notice
=
wpdesk_notice_success
(
'test function'
);
$notice
=
wpdesk_
wp_
notice_success
(
'test function'
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
$this
->
assertInstanceOf
(
Notice
::
class
,
$notice
);
...
@@ -89,11 +89,11 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -89,11 +89,11 @@ class TestFunctions extends WP_UnitTestCase
}
}
/**
/**
* Test WPDeskPermanentDismissibleNotice function.
* Test WPDeskPermanentDismissible
Wp
Notice function.
*/
*/
public
function
testWPDeskPermanentDismissibleNotice
()
public
function
testWPDeskPermanentDismissible
Wp
Notice
()
{
{
$notice
=
wpdesk_permanent_dismissible_notice
(
$notice
=
wpdesk_permanent_dismissible_
wp_
notice
(
'test function'
,
'test function'
,
'test-notice'
,
'test-notice'
,
Notice
::
NOTICE_TYPE_INFO
Notice
::
NOTICE_TYPE_INFO
...
@@ -111,9 +111,9 @@ class TestFunctions extends WP_UnitTestCase
...
@@ -111,9 +111,9 @@ class TestFunctions extends WP_UnitTestCase
/**
/**
* Test WPDeskInitNoticeAjaxHandler function.
* Test WPDeskInitNoticeAjaxHandler function.
*/
*/
public
function
testWPDeskInitNoticeAjaxHandler
()
public
function
testWPDeskInit
Wp
NoticeAjaxHandler
()
{
{
$ajax_handler
=
wpdesk_init_notice_ajax_handler
();
$ajax_handler
=
wpdesk_init_
wp_
notice_ajax_handler
();
$this
->
assertInstanceOf
(
\WPDesk\Notice\AjaxHandler
::
class
,
$ajax_handler
);
$this
->
assertInstanceOf
(
\WPDesk\Notice\AjaxHandler
::
class
,
$ajax_handler
);
}
}
...
...
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