WordPress.org

Ready to get started?Download WordPress

Forums

Back End Instructions
[resolved] Error: "Invalid post type" when filtering posts (7 posts)

  1. Rebecca
    Member
    Posted 1 year ago #

    Hi! I recently discovered this plugin and it's exactly what I need. Thanks so much!
    I just stumbled on some strange behaviour, though, and I'm not sure if I did something to cause it or if it's a bug.

    When I view all posts in the admin panel, I can search OR filter by category without issue. But if I search the posts and then filter by category, I get a blank page with "Invalid post type". I deactivated all plugins to make sure WP wasn't doing it on its own (it doesn't). I also deactivated all other plugins to make sure it wasn't a conflict between plugins. I'm using the Twenty Eleven theme, but I'll be using a custom one eventually.

    To be honest, this is such an unusual case (for me) that normally I wouldn't bother posting about it, but I know my clients, and they will stumble across this too. I'd just like to find a solution before they have a chance, haha.

    Any ideas what might be causing this? Thanks in advance!

    http://wordpress.org/extend/plugins/back-end-instructions/

  2. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    Before I post my questions, I just want to let you know that Ive had the flu for this past week, and right now i'm pretty "floaty" in the head from all the medication I'm on at the moment. This is the first day I've been able to sit at my computer for over a week - so please pardon me if the questions I ask seem a bit silly.

    Okay, so you say you have no problems searching in the admin - searching or filtering by category. But the next line is that you *do* have problems. So I'm wondering if you mean on the front end, when you search, you get an "invalid post type"? (you can find things just fine in the admin, but not on the front end?)

    if that's the case, did you make the posts available to the front end? By default, the custom post type for instructions are NOT available to front end users, and you will get an "invalid post type" if you try to access the posts from the front end of the site. You have to change the settings to allow it, and then set what user level is allowed to view them.

    I hope that makes sense :)

  3. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    Okay, nevermind. I could replicate the problem - found the issue. in the short term, the solution is to open up instructions.php, an comment out line 71:

    add_filter('pre_get_posts', 'bei_query_vars');

    That was a solution I came up with a while back to prevent the instructions from showing up within search results on the front end. However, that was written a while back, and I don't think the code is necessary anymore. I *do* want to double check on it though. But for the short term, that should work for you. I'll do some testing and see if I can get it 100% sorted, and the next release should take care of it.

  4. Rebecca
    Member
    Posted 1 year ago #

    I'm glad you could decipher my babbling! I wasn't sure how to best explain it.

    That solution works like a charm. (And the instructions don't appear to come up in the search on the front end. Yay!) Thanks so much!

    Feel better soon!

  5. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    Sweet. I've been doing testing too, and it doesn't seem to affect the search results either, so I'll apply this in the next release. Thanks for letting me know about it!

  6. restorit2
    Member
    Posted 1 year ago #

    i am having the same problem with wp 3.5. my theme is custom community pro. it does not have a php called instructions. any suggestions of a possible file name?
    i will also post this with themekraft.
    thanks

  7. Doodlebee
    Member
    Plugin Author

    Posted 1 year ago #

    The "instructions.php" file is within the back end instructions plugin, not your theme. If you don't have the back end instructions plugin installed and activated and are having this problem, then it's not a plugin issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic