@husar,
You need to put this code into a custom plugin for your site or into the functions.php file of your theme.
I don’t use More Types so I don’t know anything about it but I guess there must be a way to collect all of the post type slug names and then cycle through them adding them to the $types[] array. Something like:
$custom_types = $more_types->get_types_function();
foreach( $custom_type as type ) {
$types[] = $type;
}
@husar,
I had a little time to spare so looked through the More Types code. This is untested but I think it will work.
global $more_types;
$pages = $more_types->get_objects(array('_plugin_saved', '_plugin'));
foreach((array) $pages as $name => $page) {
$types[] = $name;
}
Thread Starter
husar
(@husar)
@mattyrob
What file in the More Types were you looking at. There are size files in that plugin. I have tried a few but not having any luck yet.
Thread Starter
husar
(@husar)
function my_post_types($types) {
$types[] = 'my_post_type';
return $types;
}
add_filter('s2_post_types', 'my_post_types');
Adding that to my functions.php seems to work now. But that only limits me to one custom post type.
@husar,
Add extra $types[] = '';
lines for each custom type until you have one for each of you custom post types.
Hi
Please,
I’ve added this code to my theme’s functions.php file but it doesn’t seem to work : no mesages sent and no toggle appears in my custom post detail page in the admin…
Must I modify that code before inserting it ?
Thanks
Hi, I use GD Taxonomies Tools (http://wordpress.org/extend/plugins/gd-taxonomies-tools/) to register/manage custom posts types and tried the code posted in this thread in functions.php
function my_post_types($types) {
$types[] = 'my_post_type';
return $types;
}
add_filter('s2_post_types', 'my_post_types');
Unfortunately, it didn’t work (I contacted GD’s author and he recommended I ask over here).
Is there possibly a differently way of setting up the functions call so it’ll work with GD tools?