Function wp_rml_create_all_parents_sql
Returns a SQL query to get all parents for a folder id. The first result for this SQL statement is the first parent and so on... Use rmltmp.lvl field for the depth number upwards. To avoid performance lacks you should figure out if there is already an action available to search for a meta_key in the action RML/$action/AnyParentHasMeta.
$options parameters:
"fields" => (string) SELECT fields (default: "rmldata.*, rmltmp.lvl AS lvlup") "join" => (string) JOIN statement (default: "") "where" => (string) Replace WHERE statement, it is preferred to use afterWhere (default: "rmltmp.lvl > " . ($includeSelf === true ? "-1" : "0")) "afterWhere"=> (string) Additional WHERE statement to the above WHERE (default: "") "orderby" => (string) ORDER BY statement (default: "rmltmp.lvl ASC") "limit" => (string) LIMIT statement (default: "")
Parameters summary
IFolder|integer |
$folder |
The folder object or folder id |
boolean |
$includeSelf = false |
Set true to include self (passed $folder) |
integer |
$until = null |
Until this folder id |
array |
$options = null |
Additional options for the SQL query, see above |