WordPress.org

Ready to get started?Download WordPress

Forums

Attachments
[resolved] Include/Exclude Attachments for specific page-ID's (6 posts)

  1. Clearsite
    Member
    Posted 1 year ago #

    Is it possible to include Attachments in the back-end based on ID instead of post-type? I want Attachments to show up for pages except the page used as static front-page.

    http://wordpress.org/extend/plugins/attachments/

  2. Jonathan Christopher
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, it's absolutely possible! When instantiating Attachments, pass along the desired ID as the second parameter:

    // retrieve Attachments for post 123
    $attachments = new Attachments( 'attachments', 123 );
  3. Clearsite
    Member
    Posted 1 year ago #

    I think you misunderstood. When using "attachments_register" and creating instances you can tell which post types to utilize ('Page'). This puts the Attachments-metabox on all pages.
    What i want to do is only have the metabox on a page of a specific ID, in my situation the page used as static homepage (get_option('page_on_front')). Is it possible to, instead of post-types like 'page', enter ID's for utilizing Attachments?

    Thanks for the help.

  4. Jonathan Christopher
    Member
    Plugin Author

    Posted 1 year ago #

    Ah ha, sorry about misunderstanding. Placement options are currently in the works but not yet available. Hopefully within the week.

  5. Jonathan Christopher
    Member
    Plugin Author

    Posted 1 year ago #

    This feature has been added in version 3.5

  6. jbx
    Member
    Posted 8 months ago #

    I need this too. Is there any example of how I can achieve this with version 3.5 and later? Can't find an example with this in the documentation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.