lp__post_hidden
lp__post_hidden is a custom query parameter used in the Launchpad Core plugin to manage the visibility of posts. This parameter acts as a flag to determine whether specific posts should be included or excluded from query results.
Product
How it Works
In WordPress, post visibility is commonly controlled using post status (e.g., publish, draft, private) and meta fields stored in wp_postmeta. Launchpad Core extends this functionality by introducing lp__post_hidden, which allows for additional filtering without replacing WordPress’ default visibility controls.
lp__post_hidden works alongside post_status and meta_query, enabling more granular control over which posts should be included or excluded in query results. This parameter is optimized to work efficiently with custom tables, reducing query overhead while maintaining compatibility with existing WordPress query structures.
Accepted Values
lp__post_hidden accepts boolean-like values:
true(1 – integer): Includes only posts marked as “hidden”.false(0 – integer): Includes only posts that are not “hidden”.
Usage
Use lp__post_hidden in your custom queries to filter posts based on their visibility status.
Example
$args = array(
'post_type' => 'rep_listing', // Replace with your actual custom post type.
'lp__post_hidden' => false, // Retrieve only posts that are not hidden.
);
$query = new WP_Query( $args );
In this example, setting 'lp__post_hidden' => false ensures that only visible posts are retrieved. Changing the value to true would return only hidden posts.
Result
| This query will return posts from the rep_listing post type based on whether they are marked as hidden or visible, providing an efficient way to control post visibility. |