WordPress.org

Ready to get started?Download WordPress

Forums

Trouble with global $pagenow (1 post)

  1. Everlast00
    Member
    Posted 1 year ago #

    Guys,

    I have my own kind of drag and drop builder, like sections for "latest posts", "normal text area" etc etc. When you click on one to edit, you can see the options in a popup.

    I use the exact same edit popup for the widgets, so I don't have to make seperate widget files.

    Now, I only want the "title" attribute to be visible for the widgets, not for the page and posts, they don't need titles.

    I did that by doing the following:

    code goes here 
    
    global $pagenow;
    
    if ($pagenow == 'widgets.php') {
       Here the title input text
    }
    
    code goes here, like other inputs that apply to both page/posts and widgets

    Now, this works fine. In posts and pages I DON'T see the title input, in widgets I DO see the title input. That's good.

    But when I save the widget, and go back to the edit popup, the title input and the saved title has disappeared.

    Any idea why that's happening?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.