• Resolved egingell

    (@egingell)


    When the plugin, WordPress Hide Posts, is installed and activated, every single post gets added to the exclude list. The call to get_posts() just returns all the posts instead of what it should.

    Pages are unaffected.

    I fixed it by changing line 76 of list-last-changes.php to $excludePosts = array();

    Posts are still ignored per WordPress Hide Posts’s rules.

    The “Link to the page you need help with:” included in this post is that of the conflicting plugin page. It’s not my page.

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author rbaer

    (@rbaer)

    Thanks for reporting the problem. I was able to reproduce the behaviour. It occures as the Hide Posts plugin changes the queries and replaces the filter made by the List Last Changes plugin. Therefore the filter to get only the excluded posts gets lost and only the filter from the Hide Posts plugin is applied.

    To fix this I need first understand if I use the wrong function or filter or if the behaviour of the Hide Posts plugin is wrong.

    So please stay tuned.

    • This reply was modified 1 year, 5 months ago by rbaer.
    Thread Starter egingell

    (@egingell)

    Edit: Double post.

    • This reply was modified 1 year, 5 months ago by egingell.
    Thread Starter egingell

    (@egingell)

    If that doesn’t work, get_option('active_plugins') returns an array of active plugins. One could check if said plugin is active and act accordingly.

    Plugin Author rbaer

    (@rbaer)

    OK, I found a way to avoid the problem. Could you test the Version 1.0.2?

    Thread Starter egingell

    (@egingell)

    They’re not sorted by Last Modified. I don’t know why, though.

    Either that or it’s excluding too many posts.

    Also, you appear to be doing it twice.

    • This reply was modified 1 year, 5 months ago by egingell.
    • This reply was modified 1 year, 5 months ago by egingell.
    • This reply was modified 1 year, 5 months ago by egingell.
    Thread Starter egingell

    (@egingell)

    How are posts being ignored in the first place?

    I’ll join here. 1.0.2 broke the website. I got a critical error.

    Plugin Author rbaer

    (@rbaer)

    @egingell :
    The filters of the Hide Posts plugin will still be active when the posts and pages are collected. Maybe this happens on your Website?

    @egingell :
    > How are posts being ignored in the first place?
    With a custom field on the post/page with the name ‘list_last_changes_ignore’ and the value ‘true’. See ‘Exclude page or post’ in the Description.

    @serpher :
    Can you post the error message here? And what version of PHP is running your website on?

    • This reply was modified 1 year, 5 months ago by rbaer.
    Thread Starter egingell

    (@egingell)

    >The filters of the Hide Posts plugin will still be active when the posts and pages are collected. Maybe this happens on your website.

    Your new version is hiding posts I’m not hiding with the other plugin.

    >With a custom field on the post/page with the name ‘list_last_changes_ignore’ and the value ‘true’. See ‘Exclude page or post’ in the Description.

    Cool. Maybe I’ll just do that instead of use this other plugin.

    >Can you post the error message here? And what version of PHP is running your website on?

    In my experience, WP doesn’t give an error message other than “critical error” (paraphrased).

    Oh, and I was mistaken about you doing it twice. It’s once for “posts” and once for “pages”. And since the coffee looks nearly identical, may I suggest wrapping one code block in:

    foreach(array("post","page") as $v) {}

    • This reply was modified 1 year, 5 months ago by egingell.
    • This reply was modified 1 year, 5 months ago by egingell.
    • This reply was modified 1 year, 5 months ago by egingell.
    • This reply was modified 1 year, 5 months ago by egingell.
    • This reply was modified 1 year, 5 months ago by egingell.
    Plugin Author rbaer

    (@rbaer)

    Updated to 1.0.3: includes now only the changes to read the exluded pages, but not the refactorings (especially type information) that seemed to cause some troubles.

    @serpher :
    I’m still interested in your PHP version to understand better what caused the error.

    @egingell :
    Thanks for the suggestion, but after the trouble the refactorings cause I’m now more on the defensive side with changes 🙂

    Thread Starter egingell

    (@egingell)

    I’ve been there.

    PS. That plugin didn’t just break yours, it also made the columns on /wp-admin/edit.php all wonky.

    https://photos.app.goo.gl/1kaqqgiVuTKN4ZdX6

    Thread Starter egingell

    (@egingell)

    Submitted for your approval.

    Marked as resolved. I cant expect you to fix or work around other peoples’ bad code. Other dude needs his own thread.

    @rbaer

    PHP Version 7.4.33

    Version 1.0.3 works fine though. Thank you!

    Plugin Author rbaer

    (@rbaer)

    Thanks for your feedback and your patience!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Conflict with plugin WordPress Hide Posts’ is closed to new replies.