Post navigation

homeTOCupnextprev

Call tree

foo() calls bar() represented in wp_postmeta

post_id meta_key meta_value
2 calls 3

We can tell that bar() is called by foo()… Access the posts by meta_key and meta_value

Who calls bar()?

[bw_list post_type=oik_api meta_key=_oik_api_calls meta_value=3]

  • foo() – foo calls bar
Notes: When defining an API we use WordPress actions to insert meta data for each function that calls a recognised API. In order to get the system to realise that foo() calls bar(), it has to know that foo() and bar() are "our APIs". On the second parse of foo() we are then able to record the fact that foo() calls bar(). When displaying the who calls me list we access the metadata by meta_value. WordPress provides some amazingly powerful APIs, e.g. get_posts(). I expose the parameters to some seemingly innocent looking shortcodes.