• Resolved ehsanmn

    (@ehsanmn)


    in my website (mwallpaper.ir) , i show attachment pages like a post, so i need to show inherit post_types in wpp query
    i changed line 463 in Query.php file from this :
    $where .= ” AND p.post_password = ” AND p.post_status = ‘publish'”;
    to this :
    $where .= ” AND p.post_password = ” AND p.post_status = ‘publish’ OR p.post_status = ‘inherit'”;

    problem is : everytime i update the plugin i should change this line in plugin files, Is there a way to change this from theme functions file?

    • This topic was modified 2 years, 7 months ago by ehsanmn.

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

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

    (@hcabrera)

    Hi @ehsanmn,

    You could use the wpp_query_where filter hook available on that very same file (see around line 473) to add your changes. That way it won’t be undone by future plugin updates.

    For example (untested, writing this from my phone right now but it should work):

    function wp8762_include_inherit_status( $where, $options ) {
        return $where . " OR p.post_status = 'publish'";
    }
    add_filter( 'wpp_query_where', 'wp8762_include_inherit_status', 10, 2 );
    Thread Starter ehsanmn

    (@ehsanmn)

    Thank you, problem solved with this code

    • This reply was modified 2 years, 7 months ago by ehsanmn.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how change posts_status from published to any’ is closed to new replies.