WP Manifestindependent plugin directory
manifest / developer / posts-to-posts-exclude

Posts 2 Posts - Exclude Parents / Children

Posts to Posts - Exclude Parents / Children

by Yaron Guez · github.com/yaronguez/posts-to-posts-exclude · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/yaronguez/posts-to-posts-exclude/archive/refs/heads/master.zip

Declares an update source (https://github.com/yaronguez/posts-to-posts-exclude), so updates arrive through the plugin's own updater.

Readme

Posts to Posts - Exclude Parents / Children

Contributors: yaronguez
Tags: posts-to-posts
Tested up to: 4.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Allow WordPress developers using the Posts 2 Posts plugin to exclude posts that are parents or children of a specific link type when using WP Query.

Description

Upon activating this plugin, just add a exclude_children or exclude_parents argument to WP Query constructor and specify the name of the link type:

// Exclude any posts that are children of type [link_name]
$query = new WP_Query(array(
    'exclude_children' => '[link_name]',
));

// Exclude any posts that are parents of type [link_name]
$query = new WP_Query(array(
    'exclude_parents' => '[link_name]',
));

[link_name] is whatever you defined your Posts to Posts relationship to be. Done!

Changelog

= 1.0 =

  • Initial version

Read the full README on GitHub →