scribu / wp-posts-to-posts

Efficient many-to-many connections between posts, pages, custom post types, users.
http://wordpress.org/plugins/posts-to-posts/
974 stars 261 forks source link

Add Posts To Posts in mu-plugin #496

Open Cezarion opened 9 years ago

Cezarion commented 9 years ago

Thank's for this great work. I try to work with wordpress in a modern way (themosis, composer, .. ) In my current project , posts to posts is a required module and I would like that's a mu plugin.

It is not working.

Do you think this is possible ?

Thanks a lot.

dstollie commented 9 years ago

I Think I can help you with this one! Im also using Themosis and I think I got this plugin working as a mu-plugin composer dependency!

  1. First add posts-to-posts as a composer dependency "wpackagist-plugin/posts-to-posts": "1.6.x"
  2. Secondly set the installer path in in your composer.json
"extra": {
    "installer-paths": {
      "htdocs/content/mu-plugins/{$name}/" : [
        "wpackagist-plugin/posts-to-posts"
      ] 
}
  1. Run a composer update. The plugin is now in the mu-plugins folder!
  2. Add the following rule to the .gitignore file: /htdocs/content/mu-plugins/posts-to-posts/
  3. Open "load.php" in the folder "htdocs/content/mu-plugins/" and add the following rule to this file:
require_once(WPMU_PLUGIN_DIR.'/posts-to-posts/posts-to-posts.php');

Good luck!

Cezarion commented 9 years ago

Thank's a lot !

I'll try that