sira162
Forum Replies Created
-
Thanks Joy. I found a way to enable a cap to a role with $role->add_cap($cap). But my problem is: How can I get all possible capabilities (also the ones who aren’t enabled anywhere)? The caps are only saved in dependance to the roles I dread and there is no function provided.
Hi and thank you for all your answers and tipps.
It was actually the problem that I had to enable all capabilities. So the post types were loaded but had no permission to be shown.
I really missed the “Enable all” button, did I overlook it or is there maybe a better way to allow everything automatically (for admin)?
Hi Andy,
I changed the code from line 273 in cpt-onomy.php to:
$query = $wpdb->prepare( "SELECT (SELECT COUNT(*) FROM {$wpdb->postmeta} wpcountmeta INNER JOIN {$wpdb->posts} wpcountposts ON wpcountposts.ID = wpcountmeta.post_id AND wpcountposts.post_status = 'publish' AND wpcountposts.post_type IN (%s) WHERE wpcountmeta.meta_key = %s AND wpcountmeta.meta_value = wpposts.ID) AS count, wpposts.* FROM {$wpdb->posts} wpposts WHERE wpposts.post_type = %s AND wpposts.post_name = %s and wpposts.post_status = 'publish'", implode( "','", $eligible_post_types ), CPT_ONOMIES_POSTMETA_KEY, $taxonomy, $value );
- This reply was modified 6 years, 8 months ago by sira162.
I solved my first problem: you just need to reorder the arguments so that, the implode function takes 2 arguments