Timeline for Conditions for admin get_current_screen action parent_file edit.php?post_type=page
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 13, 2017 at 22:12 | comment | added | Jarod Thornton |
We may have made this a little more involved than necessary. Unless you can point out any concerns with the approach, this works: if( 'page' === $current_screen->id )
|
|
Mar 13, 2017 at 21:58 | history | edited | Nathan Johnson | CC BY-SA 3.0 |
page not post
|
Mar 13, 2017 at 21:54 | comment | added | Nathan Johnson | ah. change 'edit' === $current_screen->base to 'edit' === $current_screen->parent_base | |
Mar 13, 2017 at 21:49 | comment | added | Jarod Thornton | 4.7.3 - pasteboard.co/J4onLSDn8.jpg | |
Mar 13, 2017 at 21:47 | comment | added | Nathan Johnson | What WP version are you using? What page are you trying to load the js on? /wp-admin/edit.php?post_type=page - correct? | |
Mar 13, 2017 at 21:45 | comment | added | Jarod Thornton |
I am on the correct page per your statement. If I omit if( 'edit' === $current_screen->base && 'page' === $current_screen->post_type ) the code fires. The script loads with the other header scripts such as `jquery-core.js'. It fired off a few from the last to fire. I also changed the priority though that wouldn't have anything to do with it.
|
|
Mar 13, 2017 at 21:29 | comment | added | Jarod Thornton | I appreciate your input, but still no luck. I failed to mention this in my original question and it might have an impact (unsure); I'm running multisite. | |
Mar 13, 2017 at 18:50 | history | edited | Nathan Johnson | CC BY-SA 3.0 |
add a bit and copyedit
|
Mar 13, 2017 at 18:39 | comment | added | Jarod Thornton | I follow the logic in your example. Unless I am overlooking something (very likely), I cannot get it to work. The example code I was working with has been commented out. | |
Mar 13, 2017 at 18:34 | history | edited | Nathan Johnson | CC BY-SA 3.0 |
added 209 characters in body; added 148 characters in body
|
Mar 13, 2017 at 18:26 | history | answered | Nathan Johnson | CC BY-SA 3.0 |