• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

[oik] plugins.com

WordPress plugins and themes

  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog
  • #
  • &
  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • J
  • L
  • M
  • N
  • O
  • P
  • Q
  • R
  • S
  • T
  • U
  • V
  • W
  • [

Using bw_related to find posts in a category related to a CPT fieldref value

In this post we demonstrate an example of the bw_related shortcode to find posts related to a particular field value through a matching category value.

[bw_related post_type=post category_name=_plugin_ref._oikp_slug exclude=-1]
 
List posts which are in the category determined by the value of the field _oikp_slug associated to the post referenced by the current value of the _plugin_ref field for this post. i.e. List posts categorised in “oik-fields”, including this one.
  • [bw_table] currently dependent upon oik-fields plugin
  • Documentation for the oik-fields plugin
  • New versions of oik, oik-fields and oik-css plugins
  • oik v2.1 now available
  • oik version 2.0-alpha, API and shortcode documentation
  • Problems with meta_compare=”>=” shortcode parameter in WordPress 4.0
  • Requirements for Post Meta plugins
  • Using bw_related to find posts in a category related to a CPT fieldref value

Notes

  • This is a rather convoluted example.
  • It was created primarily to demonstrate the power and complexity of the bw_related shortcode
  • It uses the concept of field references ( fieldref ) where the field value used is from a field associated with a referenced post.
  • The bw_related shortcode determines that the value for the category_name= parameter can’t be an actual category_name slug so it looks up the value to use.
  • In this case, since there is a string before the period (.), it recognises this as a fieldref.

See also

  • [bw_related]
  • oik-fields

Component:
  • oik-fields – custom post type field APIs

Published: March 1, 2014 | Last updated: December 4, 2020

Filed Under: oik-fields Tagged With: bw_related

Primary Sidebar

Information

Component:
  • oik-fields – custom post type field APIs

Recent plugin updates

oik-fields v1.55.1
oik-fields v1.55.1 oik-fields v1.55.1 has been tested with WordPress 7.1. ...
oik v4.16.0
oik v4.16.0 Upgrade to oik v4.16.0 for many accessibility (a11y) improvements for both the front end and admin areas, plus a security fix. ...
oik-fields v1.55.0
oik-fields v1.55.0 Upgrade to oik-fields v1.55.0 for accessibility improvements to the featured image virtual field. ...
oik-css v2.4.0
oik-css v2.4.0 Upgrade to oik-css v2.4.0 for accessibility improvements for Low Color Contrast errors. ...
oik-unloader v0.4.0
oik-unloader v0.4.0 Update to oik-unloader v0.4.0 for improved accessibility of the active-plugins shortcode. Tested with WordPress 6.9 and PHP 8.4 ...

Footer

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: oikplug@oik-plugins.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2026. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins

WordPress version: 7.1.2

Gutenberg version: 24.0.0

PHP version: 8.2.35