Plugin Author
scribu
(@scribu)
Ok, so the ‘client’ role has the ‘edit_offers’ capability, right?
yes they do, they can post/edit offers.
Plugin Author
scribu
(@scribu)
This code works fine for me, on WP 3.2.1, with the development version I last linked to:
add_action( 'init', 'init_stuff' );
function init_stuff() {
register_post_type( 'company', array(
'public' => true,
'label' => 'Companies',
'capability_type' => 'company'
) );
register_post_type( 'offer', array(
'public' => true,
'label' => 'Offers',
'capability_type' => 'offer'
) );
p2p_register_connection_type(array(
'id' => 'posts_to_offer',
'from' => 'post',
'to' => 'offer',
'reciprocal' => true
));
p2p_register_connection_type(array(
'id' => 'company_to_offer',
'from' => 'company',
'to' => 'offer',
'reciprocal' => true
));
}
If you’re using a plugin to register the post types, disable it and try the above code instead.
If it still doesn’t work, it means there’s some other plugin interfering.
Thanks scribu
I will have a look at this tomorrow
Thx Again for your support, not sure how you manage but you are a rare one that everybody needs.
I will be more than happy to contribute to a nice xmas present or a beer fund if you have something set up somewhere
Plugin Author
scribu
(@scribu)
You’re welcome. The beer fund is at http://scribu.net/paypal π
me again sorry…
Whatever I try, same issue.
Only Admin seem to be able to Connect a post to a Custom Post Type (Offer or Destination).
Editor or in my case Client, even with the correct rights set up in Adminize, cannot link a Post to a Custom post type.
I cant understand what’s wrong.
HELP…please π
trying to debug, and the console throws the errors here
http://pastebin.com/55FHrYNm
if (!response.rows) {
Plugin Author
scribu
(@scribu)
Did you try deactivating all other plugins?
Did you try the code I posted last time?
Are you on the development version (1.0.1-alpha2)?
Ok some update on this.
Running version (1.0.1-alpha2)
Using your code above APART from Capability type of my Custom Post Type.
In your code you wrote ‘capability_type’ => ‘company’
In my code I have ‘capability_type’ => ‘page’
If I change it Company, I lose my CPT in dashboard.
Running all this, I only get the Connected Post metabox (no Company or Destination).
puzzled….
Just realized something.
Offers = Post
Destination = Pages.
Connection works from Post to Offer (reciprocal)
Connection dont work from Post to Destination (capability page)
which is normal, as your plugin is called POSTS 2 POSTS….
BUT, why can I create the connections when logged in as an ADMIN?
Plugin Author
scribu
(@scribu)
Connection dont work from Post to Destination (capability page)
which is normal, as your plugin is called POSTS 2 POSTS…
That is incorrect. It should work between any post type, with any capability setting (as long as the user’s role has the appropriate capabilities).
Have you tried deactivating all other plugins, like I suggested? Also might be a good idea to switch to the bundled theme.
I did deactivate the plugins. not results.
I am glad the connection works between CPT (posts or pages) and posts.
In your code, why is the capability_type is set to the same name as the post type?
I thought only a Type of Post or Page can be set there? (if i change this, I lose my CPT)
s
Plugin Author
scribu
(@scribu)
Listen, how about we talk via IRC? I’m in the #wordpress channel on freenode.
Finally fixed it thx to Scribu.
My CPT had Page capability and my client didnt have permission to edit Pages, hence the box not working.
Removing the capability_type for my CPT fixed my issue.