noderef
field type to store references to other nodes, where node is a generic term for a post which can be of any type ( post, page or a custom post type (CPT))
Create the noderef
field type using
You appear to be a bot. Output may be restricted
bw_register_field( "_oikpv_plugin", "noderef", "Plugin", array( '#type' => 'oik-plugins') ); bw_register_field_for_object_type( "_oikpv_plugin", 'oik_pluginversion' );
Form display
When displayed in the Fields meta box or [bw_new] it appears as a single selection drop down list.bw_fields display
When displayed by [bw_fields] it appears like this.Notes
To reference multiple post types extend the #type argumentYou appear to be a bot. Output may be restricted
$purchasable_product_type = array(); $purchasable_product_type[] = "download"; $purchasable_product_type[] = "product"; bw_register_field( "_oikp_prod", "noderef", "Purchasable product", array( '#type' => $purchasable_product_type, '#optional' => true ) );The noderef type supports multiple selection.
You appear to be a bot. Output may be restricted
bw_register_field( "_oik_api_hooks", "noderef", "Uses hooks", array( "#type" => "oik_hook", "#multiple" => true, "#optional" => true, '#theme' => false ));