WordPress.org

Support

Support » Plugins and Hacks » DM Albums » DM Albums x Custom Post Types

DM Albums x Custom Post Types

  • Hi fstrack and friends,

    I´m using the great DM Albums plugin and have 2 quastions:

    1) Is localization suppot planned to the next version?
    2) Is there a way to change the post type the pluggin is allowed to be used? Now, just Posts have the DM Albums options… I would like to use it in another post type instead…

    Thanks!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Add me to the list of those who would like to use custom post types.

    I was looking for this myself and just figured it out. Its rather simple.

    Open the file: wp-dm-albums.php and go to line 788. You will find the following function here:

    function dm_manage_dmalbums_metabox()
    {
    if(function_exists('add_meta_box') && current_user_can('upload_files'))
    {
    add_meta_box( 'dmalbums_manager_id', __( 'DM Albums™ Album Manager', 'dm_albums_textdomain' ),
    'dm_manage_albums_box', 'post', 'side', 'high');
    add_meta_box( 'dmalbums_manager_id', __( 'DM Albums™ Album Manager', 'dm_albums_textdomain' ),
    'dm_manage_albums_box', 'page', 'side', 'high');
    }
    }

    The add_meta_box function will insert the DM Albums where you want it. As you can see in the code here, it is currently set to display in ‘post’ and ‘page’. All you need to do is add this line before the first add_meta_box:


    add_meta_box( 'dmalbums_manager_id', __( 'DM Albums™ Album Manager', 'dm_albums_textdomain' ),
    'dm_manage_albums_box', 'YOUR POST TYPE NAME HERE', 'side', 'high');

    Change “YOUR POST TYPE HERE” to the name of your custom post type and you are good to go.

    Just a side note, I have found another way to include DM Albums in custom post types. Depending on your specific needs, this may be a better method as you would most likely have to update the code every time DM Albums is updated.

    If you already have a custom post type created, simply add the “More Fields” plugin and you will see that it displays DM Albums as a “Box created elsewhere”. Simply click “Override” and you can then check all the post types and pages you want DM Albums to be included with.

    Thanks for the tip!! Great work!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘DM Albums x Custom Post Types’ is closed to new replies.
Skip to toolbar