Function wp_rml_select_tree
Returns a .rml-root-list with an given tree. The selected folder id is saved automatically in a hidden input type.
Note #1 The select tree has a javascript callback when it is initalized. You can bind it with this snippet:
window.rml.hooks.register("tree/custom", function(obj, $) { //if (obj.hasClass("my-extra-class")) { alert(obj.html()); //} });
Note #2 If you want to use the select tree after a DOM change (ajax, for example: Modal dialog in visual editor) please call the javascript function
window.rml.library.customLists()
to affect the initalization referred to Note #1.
Note #3 You can use a sub class of IFolder to customize your tree.
Returns:
string Formatted HTML string
Located at folders.php
Located at folders.php
Parameters summary
string |
$inputName |
the name for the hidden input type and the name for the list |
integer |
$selected |
the selected folder id (saved also in hidden input type) |
IFolder |
$tree = null |
The root view |
string |
$extraClasses = "" |
classes for the rml root list container |