{"id":9503,"date":"2010-06-29T21:10:30","date_gmt":"2010-06-29T21:10:30","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/relation-post-types\/"},"modified":"2013-06-17T06:25:35","modified_gmt":"2013-06-17T06:25:35","slug":"relation-post-types","status":"publish","type":"plugin","link":"https:\/\/test.wordpress.org\/plugins\/relation-post-types\/","author":161212,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.1","stable_tag":"1.3.1","tested":"3.5.2","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"Relation Post Types","header_author":"Amaury Balmer, Nicolas Juen","header_description":"","assets_banners_color":"","last_updated":"2013-06-17 06:25:35","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.beapi.fr\/donate\/","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/relation-post-types\/","header_author_uri":"http:\/\/www.beapi.fr","rating":5,"author_block_rating":0,"active_installs":200,"downloads":8276,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.11","1.0.12","1.0.13","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","1.2.4","1.3","1.3.1"],"block_files":[],"assets_screenshots":{"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1573772","resolution":"2","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1573772","resolution":"1","location":"plugin"}},"screenshots":{"1":"Metabox in Post Types for creating a relation","2":"Option page to set relations between two content types"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[225,527,2008,2278,11163],"plugin_category":[],"plugin_contributors":[77912,77913],"plugin_business_model":[],"class_list":["post-9503","plugin","type-plugin","status-publish","hentry","plugin_tags-cms","plugin_tags-custom","plugin_tags-post-type","plugin_tags-post-types","plugin_tags-relation","plugin_contributors-momo360modena","plugin_contributors-rahe","plugin_committers-momo360modena"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/relation-post-types.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/relation-post-types\/trunk\/screenshot-1.png?rev=1573772","caption":"Metabox in Post Types for creating a relation"},{"src":"https:\/\/ps.w.org\/relation-post-types\/trunk\/screenshot-2.png?rev=1573772","caption":"Option page to set relations between two content types"}],"raw_content":"<!--section=description-->\n<p>This plugin allow to build relation between 2 custom types (posts, page, custom), very useful for manage related content on CMS type website.<\/p>\n\n<p>A few example use cases:<\/p>\n\n<ul>\n<li>manually lists of related posts<\/li>\n<li>post series<\/li>\n<li>rented houses connected to agency<\/li>\n<li>etc.<\/li>\n<\/ul>\n\n<p>Relationships are created from a settings page from the administration console.<\/p>\n\n<p>This plugin can not do relationships with users, you should test this excellent plugin made by scribu\nhttp:\/\/wordpress.org\/extend\/plugins\/posts-to-posts\/<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Download, unzip and upload to your WordPress plugins directory<\/li>\n<li>Activate the plugin within you WordPress Administration Backend<\/li>\n<li>Go to Settings &gt; Relations and enable relation between post type.<\/li>\n<\/ol>\n\n<h4>Display relations in its theme<\/h4>\n\n<p>Example, display 5 related pages in your single.php template :<\/p>\n\n<pre><code>&lt;?php\n$related_pages_ids = rpt_get_object_relation($id_post, 'page');\nif ( count($related_pages_ids) &gt;= 1 ) {\n    $related_pages = query_posts( array(\n        'post_type' =&gt; 'page',\n        'post_status' =&gt; 'publish',\n        'posts_per_page' =&gt; 5\n        'post__in' =&gt; $related_pages_ids,\n        'orderby' =&gt; 'post_date',\n        'order' =&gt; 'DESC',\n    ) );\n\n    echo 'Related pages' . \"\\n\";\n    echo '&lt;ul&gt;' . \"\\n\";\n    foreach ( $related_pages as $post ) {\n        echo '&lt;li&gt;&lt;a href=\"'.get_permalink($post).'\"&gt;'.get_the_title($post).'&lt;\/a&gt;&lt;\/li&gt;' . \"\\n\";\n    }\n    echo '&lt;\/ul&gt;' . \"\\n\";\n}\n?&gt;\n<\/code><\/pre>\n\n<!--section=changelog-->\n<ul>\n<li>Version 1.3.1 :\n\n<ul>\n<li>Change settings for quantity, allow to set quantity for each post type<\/li>\n<li>Add DIE for direct access<\/li>\n<li>Add UNINSTALL method, remove only option. (not yet DB) <\/li>\n<li>Move translation to INIT hook<\/li>\n<\/ul><\/li>\n<li>Version 1.3 : \n\n<ul>\n<li>Compatibility with WP 3.5<\/li>\n<li>Refactory code: use static methods, use views, new conding standards<\/li>\n<li>Add setting for set quantity items<\/li>\n<li>Improve performance for rpt_get_objects_most_used()<\/li>\n<\/ul><\/li>\n<li>Version 1.2.4 : \n\n<ul>\n<li>Compatibility with WP 3.4<\/li>\n<\/ul><\/li>\n<li>Version 1.2.3 :\n\n<ul>\n<li>No released version<\/li>\n<\/ul><\/li>\n<li>Version 1.2.2 : \n\n<ul>\n<li>Fix a potential error with PHP Opcode Cache<\/li>\n<li>Remove most recent tab, performance bad<\/li>\n<\/ul><\/li>\n<li>Version 1.2.1 :\n\n<ul>\n<li>Add query var with prefix \"rel-\" for each CPT allow filtering on URL<\/li>\n<\/ul><\/li>\n<li>Version 1.2 :\n\n<ul>\n<li>Stable enough for remove beta version<\/li>\n<li>Add some template functions for an easier usage<\/li>\n<li>Fix a very rare bug when a post type have relation with the same post type and when this relation is empty, that delete others relations of this post id. (thanks to bniess for reporting bug)<\/li>\n<\/ul><\/li>\n<li>Version 1.1-beta2 :\n\n<ul>\n<li>Fix possible bug with others plugin's beapi that use import <\/li>\n<\/ul><\/li>\n<li>Version 1.1-beta1 :\n\n<ul>\n<li>Add tab for searching<\/li>\n<li>Add tab to select most used elements<\/li>\n<li>Add function to get the most associated elements from a post_type<\/li>\n<li>Add import\/export config tool<\/li>\n<\/ul><\/li>\n<li>Version 1.0.13 :\n\n<ul>\n<li>Fix a warning on admin write page<\/li>\n<\/ul><\/li>\n<li>Version 1.0.12 :\n\n<ul>\n<li>Fix a bug with CSS not existing. (bug copy\/paste)<\/li>\n<li>Add a argument for get single relation<\/li>\n<\/ul><\/li>\n<li>Version 1.0.11 :\n\n<ul>\n<li>Fix name plugin<\/li>\n<li>Possible fix for widget, add reset and use \"post__in\" instead \"include\"<\/li>\n<\/ul><\/li>\n<li>Version 1.0.10 :\n\n<ul>\n<li>Fix bug with data lost and quick edit<\/li>\n<\/ul><\/li>\n<li>Version 1.0.9 :\n\n<ul>\n<li>Fix possible bug with folder name<\/li>\n<li>Fix bug with functions API and switch_to_blog()<\/li>\n<\/ul><\/li>\n<li>Version 1.0.8 :\n\n<ul>\n<li>Fix potential warning during saving.<\/li>\n<li>Fix bug that not allow to uncheck all relations<\/li>\n<\/ul><\/li>\n<li>Version 1.0.7 :\n\n<ul>\n<li>Fix several bugS during saving relations, get relations.<\/li>\n<\/ul><\/li>\n<li>Version 1.0.6 :\n\n<ul>\n<li>Check compatibility with WP 3.0.1<\/li>\n<li>Fix constant construction. (try dynamic method)<\/li>\n<\/ul><\/li>\n<li>Version 1.0.5 :\n\n<ul>\n<li>Fix renaming class<\/li>\n<\/ul><\/li>\n<li>Version 1.0.4 :\n\n<ul>\n<li>Fix generation of metabox on admin. Fix for correspond to description and remove stupid return...<\/li>\n<\/ul><\/li>\n<li>Version 1.0.3 :\n\n<ul>\n<li>Fix notices<\/li>\n<li>Allow relations between objects of the same post type<\/li>\n<\/ul><\/li>\n<li>Version 1.0.2 :\n\n<ul>\n<li>Optimize some PHP codes<\/li>\n<li>Add POT language + French<\/li>\n<\/ul><\/li>\n<li>Version 1.0.1 :\n\n<ul>\n<li>Finalize widget !<\/li>\n<li>Add nonce for improve security<\/li>\n<\/ul><\/li>\n<li>Version 1.0.0 :\n\n<ul>\n<li>First version stable<\/li>\n<\/ul><\/li>\n<\/ul>","raw_excerpt":"This plugin allow to build relation between 2 custom types (posts, page, custom), very useful for manage related content on CMS type website.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/9503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=9503"}],"author":[{"embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/momo360modena"}],"wp:attachment":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=9503"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=9503"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=9503"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=9503"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=9503"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=9503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}