• OnTrack

    (@ecomlearning)


    I hope you don’t mind, but I have two suggestions for your simple yet very useful plugin (how is this not already a feature in WP?!).

    1. To include scheduled pages in the items to hide from the menu you could edit your code
    from IN ('pending', 'draft', 'trash')
    to IN ('pending', 'draft', 'trash', 'future')
    It worked for me with one page, but that’s not extensive testing.

    2. If a menu has sub items and the parent is draft etc then all the sub items should be hidden from the menu too, otherwise they are added to the bottom of the menu by WP which is not ideal.
    To accomplish this you could maybe call get_children() function for each page in your $unpublished_items array. Recursively call the parent function to account for sub items n-levels deep.

    I hope you find this useful and find time to continue developing the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author room34

    (@room34)

    Great suggestions!

    As it happens, I have almost never worked with sites that had scheduled posts, and the test sites I’ve been using to develop this plugin didn’t have any, so I was unaware of the “future” post_status value. I’ll add that.

    Filtering out the submenu items may be a bit trickier but I’ll look into that as well.

    Thread Starter OnTrack

    (@ecomlearning)

    To be honest, I only came across the idea of scheduled posts yesterday.

    Yes, sub menu filtering will take more effort, I find it takes a certain mindset to think recursively.
    If I get time I’ll play about with it a bit and drop a note back for you.

    Glad to help.
    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2 suggestions’ is closed to new replies.