I'm using Pods plugin (ver 2.2) to create some 'Pods' or Advanced Content Types, as they would refer to it, which are like custom post types but are actually separate from WP, blank slate, in their own tables. Each content type has at least two fields.
What I wanted to know is how do I display those field inputs in the manage page columns of those Advanced Content Types (created with the Pods interface)? By default it is only showing one column, ie. the default field.
Using manage_${post_type}_posts_columns doesn't seem to work since they're not really post types.
Further research lead me to pods_ui(), but the result is undesirable: the list is blank (pic #1) and there seems to be another Pod item(?) at the bottom (pic #2).
Effort #1
This was the code:
function pods_ui_test() {
$object = pods('cities');
$object->ui = array(
'columns' => array(
'cities' => 'Cities',
'regions' => 'Regions'
),
);
pods_ui($object, true);
}
add_filter( 'pods_admin_ui_cities', 'pods_ui_test' );
Pic #1:
Pic #2:
Anybody familiar with how Pods work?
Effort #2
@ScottKingsleyClark... I think I understand what you mean, so I gave it another shot. Here's the code:
function pods_ui_test($object) {
$pod = $object[pod];
// Test on TITLE
$pod->pod_data[label] = 'XXXXX';
// Test on UI Column
$pod->ui = array(
'columns' => array(
'city' => 'City',
'region' => 'Region'
)
);
return $object;
}
add_filter( 'pods_admin_ui_cities', 'pods_ui_test' );
I tested by changing the title and the column UI to see if it has any effects at all. The former works, ie.the TITLE changed, but the column remains the same, ie. only one is showing which is the default field.