modulbuero
Forum Replies Created
-
I found myself struggling with the same problem and found some kind of workaround. You can register the same kdMultipleFeaturedImages-ID again and again with different post types. So you’ve got no problem handling the images in the backend.
To display them in your template, you just have to put your post_type into a variable. Check this pastebin:
Hope this helps someone.
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Connection to one page only?Yap, perfekt, that worked. Thank you very much for your help!
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Connection to one page only?When you click on “All Connections” (sorry if i translate this wrong, working in german) or if you search for a connected item, it just doesn’t return anything.
By the way: thanks for your endurance!
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Connection to one page only?Back at 1.3.1 my other approach does hide the box, but also breaks the connection as mentioned above:
function unternehmensleitung( $show, $ctype, $post ) { if ( 'unternehmensleitung' === $ctype->name && $post->ID !== '11' ) { $show = false; } return $show; } add_filter( 'p2p_admin_box_show', 'unternehmensleitung', 50, 3 );
Why can it break the connection, when it doesn’t even change anything on that very page?
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Connection to one page only?Right, the filter works here. But it doesn’t do, what i expected it to do. The connection admin box still shows up, still shows “Create Connection” and just fails by trying the latter if not on the page i specified.
Additionally, the development version breaks my other approach via p2p_admin_box_show with an error:
Fatal error: Cannot break/continue 1 level in /is/htdocs/XXXXXXXXXX/www/wp-content/plugins/posts-to-posts/admin/box-factory.php on line 47
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Connection to one page only?That just hides the box on the other pages, but breaks the connection itself – it doesn’t find the posts to connect anymore.
So i went back to your suggestion, but the filter doesn’t seem to work. It doesn’t even dump the variables:
function unternehmensleitung( $args, $ctype, $post_id ) { var_dump($ctype->name); var_dump($ctype->get_direction()); if ( 'unternehmensleitung' == $ctype->name && 'to' == $ctype->get_direction() ) { $args['page'] = 'unternehmen'; } return $args; } add_filter( 'p2p_connectable_args', 'unternehmensleitung', 10, 3 );
Any idea what goes wrong?
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Connection to one page only?Mh, could’nt get that to work – but used this instead:
function unternehmensleitung( $show, $ctype, $post ) { if ( 'unternehmensleitung' == $ctype->name ) if($post->ID == 11) { return $show; } else { return false; } return $show; } add_filter( 'p2p_admin_box_show', 'unternehmensleitung', 50, 3 );