Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare to get_current_screen #5

Closed
grappler opened this issue Feb 10, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@grappler
Copy link

commented Feb 10, 2014

I did a check with get_current_screen() and I was getting differnt results then the plugin. I noticed it on the theme page with the parent_base.

This is with version 1.1.1

@bradvin

This comment has been minimized.

Copy link
Member

commented Feb 10, 2014

@grappler that is strange - I am pretty sure that code has not changed.

But I did a test on the themes page and got the same value for parent_base:

image

@jrfnl

This comment has been minimized.

Copy link
Collaborator

commented Feb 10, 2014

@grappler /cc @bradvin The plugin uses get_current_screen() internally to retrieve the information, so a difference shouldn't even be possible. Very strange.

Have you got some screen shots showing the diffs ?

@grappler

This comment has been minimized.

Copy link
Author

commented Feb 10, 2014

Yes,
image

@jrfnl

This comment has been minimized.

Copy link
Collaborator

commented Feb 10, 2014

@grappler Thank you.

I believe I've figured out what the problem is, unfortunately not all too much we can do about it.

The method within WP_Screen() which sets the parent values set_parentage() is called from within admin_header.php after the menu parent for the screen has been determined.
Unfortunately on the admin side the Admin Bar loads before the page is loaded which includes admin_header.php.... (on the Front end the admin bar loads at the end).

A (dirty) work-around would be to copy the set_parentage() method and retrieve the values locally for use by the plugin. Nicer would be to call the WP_Screen::set_parentage() method. I'd need to check if that would not have any adverse effects.

jrfnl added a commit to jrfnl/debug-bar-screen-info that referenced this issue Feb 10, 2014

Issue fooplugins#5 - Fix for parentage not being set as admin bar is …
…loaded too early

Includes updated changelog in readme and upped version nrs for this change.
@jrfnl

This comment has been minimized.

Copy link
Collaborator

commented Feb 10, 2014

@bradvin I've send in PR #6 which will fix this in most cases.
@grappler Thank you for reporting!

@grappler

This comment has been minimized.

Copy link
Author

commented Feb 10, 2014

@jrfnl Thank you for fixing it. 😄

@grappler grappler closed this Feb 10, 2014

@jrfnl

This comment has been minimized.

Copy link
Collaborator

commented Feb 10, 2014

@grappler You're welcome ;-)

bradvin added a commit that referenced this issue Feb 11, 2014

Merge pull request #6 from jrfnl/master
Issue #5 - Fix for parentage not being set as admin bar is loaded too early
@bradvin

This comment has been minimized.

Copy link
Member

commented Feb 11, 2014

thanks @jrfnl @grappler
I will release an update to wp.org later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.