Linux 软件免费装

[NPC] Neatek Post Connect (many-to-many)

开发者 neatek
更新时间 2019年6月18日 17:48
捐献地址: 去捐款
PHP版本: 7.0 or high 及以上
WordPress版本: 5.2.1
版权: GPLv2 or later
版权网址: 版权信息

标签

posts links custom post types connections relationships many-to-many posts2posts

下载

1.0.1

详情介绍:

This plugin can make Many-To-Many connections of posts (also custom posts), you can setup it in wp-admin/options-general.php?page=neatek-posts-connects Plugin supports English and Russian languages. Snippet to get connected posts: <?php // $post_id = get_the_id(); $query = npc_query_connected($post_id, 'needed_post_type'); while($query->have_posts()) { $query->the_post(); the_title(); } ?> It will get all connected posts with posttype 'needed_post_type' for $post_id ID Post. Also, you can get_posts() connected posts. <?php // $post_id = get_the_id(); $c_posts = npc_get_connected($post_id, 'needed_post_type'); var_dump($c_posts); ?> You can modify WP_Query or get_posts() args: <?php $args = array( 'posts_per_page' => 5 ); // $post_id = get_the_id(); $c_posts = npc_get_connected($post_id, 'needed_post_type', $args); ?> Or you can just get IDS of connected posts: <?php // $post_id = get_the_id(); $ids = npc_get_post_ids($post_id, 'needed_post_type'); var_dump($ids); ?> Important: Do not use 'numberposts', use 'posts_per_page'. The best alternative for: https://ru.wordpress.org/plugins/posts-to-posts/ Thank you for using my plugin.

安装:

Just install and press activate, and start setup.
  1. Go to wp-admin/options-general.php?page=neatek-posts-connects and connect some types of posts.
  2. Go to any posts in connected types.
  3. Create link between posts.
  4. Use Plugin functions in Theme.

升级注意事项:

1.0 Alternative for posts2posts.

更新日志:

1.0 First release.