File tree Expand file tree Collapse file tree 7 files changed +14
-29
lines changed Expand file tree Collapse file tree 7 files changed +14
-29
lines changed Original file line number Diff line number Diff line change 21
21
*
22
22
* @since 1.6.0
23
23
*/
24
- function cptui_about_assets () {
25
- $ current_screen = get_current_screen ();
24
+ function cptui_about_assets ( $ hook ) {
26
25
27
- if ( ! is_object ( $ current_screen ) || 'toplevel_page_cptui_main_menu ' !== $ current_screen -> base ) {
26
+ if ( 'toplevel_page_cptui_main_menu ' !== $ hook ) {
28
27
return ;
29
28
}
30
29
Original file line number Diff line number Diff line change 21
21
*
22
22
* @since 1.6.0
23
23
*/
24
- function cptui_listings_assets () {
25
- $ current_screen = get_current_screen ();
24
+ function cptui_listings_assets ( $ hook ) {
26
25
27
- if ( ! is_object ( $ current_screen ) || 'cpt-ui_page_cptui_listings ' !== $ current_screen -> base ) {
26
+ if ( 'cpt-ui_page_cptui_listings ' !== $ hook ) {
28
27
return ;
29
28
}
30
29
Original file line number Diff line number Diff line change 23
23
*
24
24
* @internal
25
25
*/
26
- function cptui_post_type_enqueue_scripts () {
26
+ function cptui_post_type_enqueue_scripts ( $ hook ) {
27
27
28
- $ current_screen = get_current_screen ();
29
-
30
- if ( ! is_object ( $ current_screen ) || 'cpt-ui_page_cptui_manage_post_types ' !== $ current_screen ->base ) {
28
+ if ( 'cpt-ui_page_cptui_manage_post_types ' !== $ hook ) {
31
29
return ;
32
30
}
33
31
Original file line number Diff line number Diff line change 23
23
*
24
24
* @internal
25
25
*/
26
- function cptui_support_enqueue_scripts () {
26
+ function cptui_support_enqueue_scripts ( $ hook ) {
27
27
28
- $ current_screen = get_current_screen ();
29
-
30
- if ( ! is_object ( $ current_screen ) || 'cpt-ui_page_cptui_support ' !== $ current_screen ->base ) {
28
+ if ( 'cpt-ui_page_cptui_support ' !== $ hook ) {
31
29
return ;
32
30
}
33
31
Original file line number Diff line number Diff line change 23
23
*
24
24
* @internal
25
25
*/
26
- function cptui_taxonomies_enqueue_scripts () {
26
+ function cptui_taxonomies_enqueue_scripts ( $ hook ) {
27
27
28
- $ current_screen = get_current_screen ();
29
-
30
- if ( ! is_object ( $ current_screen ) || 'cpt-ui_page_cptui_manage_taxonomies ' !== $ current_screen ->base ) {
28
+ if ( 'cpt-ui_page_cptui_manage_taxonomies ' !== $ hook ) {
31
29
return ;
32
30
}
33
31
Original file line number Diff line number Diff line change 23
23
*
24
24
* @return void
25
25
*/
26
- function cptui_tools_assets () {
27
- $ current_screen = get_current_screen ();
26
+ function cptui_tools_assets ( $ hook ) {
28
27
29
- if ( ! is_object ( $ current_screen ) || 'cpt-ui_page_cptui_tools ' !== $ current_screen -> base ) {
28
+ if ( 'cpt-ui_page_cptui_tools ' !== $ hook ) {
30
29
return ;
31
30
}
32
31
Original file line number Diff line number Diff line change @@ -431,21 +431,15 @@ function cptui_newsletter_form() {
431
431
* @author Scott Anderson <[email protected] >
432
432
* @since 1.7.3
433
433
*/
434
- function enqueue_email_octopus_assets () {
435
-
436
- $ current_screen = get_current_screen ();
437
-
438
- if ( ! is_object ( $ current_screen ) ) {
439
- return ;
440
- }
434
+ function enqueue_email_octopus_assets ( $ hook ) {
441
435
442
436
$ screens = [
443
437
'toplevel_page_cptui_main_menu ' ,
444
438
'cpt-ui_page_cptui_manage_post_types ' ,
445
439
'cpt-ui_page_cptui_manage_taxonomies ' ,
446
440
];
447
441
448
- if ( ! in_array ( $ current_screen -> base , $ screens , true ) ) {
442
+ if ( ! in_array ( $ hook , $ screens , true ) ) {
449
443
return ;
450
444
}
451
445
You can’t perform that action at this time.
0 commit comments