Greetings WordPress Experts,

I'm looking for some help with a rather specific issue and my hope is that someone here could point me in the right direction.

I'll spare you the long and boring details of the whole reason, but I need to find a method of determining if the page I am currently on is being edited. The reason for this (short version) is that I need to ensure a certain class is not shown when the page is being edited, but to display it when it's not.

I've tried various attempts with get_current_screen but these are just returning null, and I've also tried to use the global $pagenow but this just always returns index.php, despite immediately showing post.php and then changing.

I've also tried is_admin() checks, but as I am using a front-end visual builder, it's not technically on the Dashboard.

I simply need to find a method of checking whether or not the page is being edited, and from there, I can figure the rest. As I said, I've tried an extensive search online, and none of the provided solutions work.

I'm curious to know if anyone here has experience with this. If so, please let me know.

Kind regards, Alec

  • If you’re editing it from the front end, then it would depend entirely on what page builder you’re using. – Jacob Peattie Oct 24 '17 at 11:16
  • Elementor is what we're using. I'm trying to find a solution that isn't too reliant on that, and is more orientated towards WordPress itself. – Alec Weekes Oct 24 '17 at 11:17
  • WordPress doesn’t have a front end editor, so has no way of telling you if you’re editing on the front end. Any solution is going to depend entirely on the front end editor you’re using. – Jacob Peattie Oct 24 '17 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.