WordPress.org

Forums

Posts 2 Posts
[resolved] Create custom admin box and custom field (7 posts)

  1. Marco Schmoecker
    Member
    Posted 3 years ago #

    Hi Scribu,

    Thanks for this awesome plugin!

    I want to add some new functionality to the admin box in the "New ..." tab:
    When you create a new (connected) post or CPT via the (edit post page) admin box than:
    -> Show a 2nd text field to add a new custom field for that post/CPT (not for the connection).

    The current situation/flow is that you can create a new post/CPT but you have to switch over to the new post/CPT to e.g. add a custom field, etc.

    Is there a way to do that via a filter/new template in some way, or do I need to create my own admin box to make that work? Thanks!

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    The thing is that, besides modifying the metabox HTML, you also need to be able to hook into the AJAX handler to save the custom field.

    There are currently no hooks for either.

  3. Marco Schmoecker
    Member
    Posted 3 years ago #

    So, basically I'd have to develop my own metabox and AJAX handler to accomplish saving a custom field with (newly created) connected post/CPT?

  4. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, you'd have to make your own metabox, but you don't necessarily need to use AJAX with it.

  5. Marco Schmoecker
    Member
    Posted 3 years ago #

    Thanks!

    Is there an example of a custom meta box around in combination with your plugin? Should I base my custom meta box on the one in your plugin, or would that create more work on my part vs. simply creating my own metabox.

    And, should I use your plugins methods to save the connection data?

    Cheers!

  6. scribu
    Member
    Plugin Author

    Posted 3 years ago #

  7. Marco Schmoecker
    Member
    Posted 3 years ago #

    Ah, thanks! RTFM I guess :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic