jchristopher / attachments

[WordPress Plugin] Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
wordpress.org/extend/plugins/attachments/
GNU General Public License v2.0
239 stars 78 forks source link

Attachments is visible in page/posts always. #116

Closed brunocascio closed 10 years ago

brunocascio commented 10 years ago

Hi!

I defined in wp-config:

define( 'ATTACHMENTS_DEFAULT_INSTANCE',  false );

functions.php

add_action( 'attachments_register', 'radio_attachments' );
function radio_attachments( $attachments )
{
  $args = array(

    // title of the meta box (string)
    'label'         => 'Integrantes',

    // all post types to utilize (string|array)
    'post_type'     => array('programacion') // or 'programacion',

.....

But, the attachments is visible in All posts/pages.

My wordpress version is 3.8.1

brunocascio commented 10 years ago

Maybe the problem is here

 function setup_instances()
        {
            // implement our default instance if appropriate
            if( !defined( 'ATTACHMENTS_DEFAULT_INSTANCE') )
                $this->register();

                // facilitate user-defined instance registration
                do_action( 'attachments_register', $this );
        }
jchristopher commented 10 years ago

You need to define ATTACHMENTS_DEFAULT_INSTANCE as true

brunocascio commented 10 years ago

I set to define( 'ATTACHMENTS_DEFAULT_INSTANCE', true ); , but doesn't work.

jchristopher commented 10 years ago

Whoops sorry you were correct with define( 'ATTACHMENTS_DEFAULT_INSTANCE', false );, I apologize. Is the default instance showing up everywhere, or just the one you created?

brunocascio commented 10 years ago

Yes... is a default instance :/ because i defined the attachments, only in a custom post type, previously created...

jchristopher commented 10 years ago

There must be another issue, where in your wp-config did you add the define? Try adding it to the top if you added it to the bottom.

On Feb 4, 2014, at 7:15 PM, Bruno notifications@github.com wrote:

Yes... is a default instance :/ because i defined the attachments, only in a custom post type, previously created...

— Reply to this email directly or view it on GitHub.

brunocascio commented 10 years ago

Yesss! I work! I add in first line of wp-config, Thanks!!! :) :+1:

jchristopher commented 10 years ago

Awesome, enjoy Attachments!