WordPress.org

Forums

DM Albums
DM Albums x Custom Post Types (5 posts)

  1. Cristiano
    Member
    Posted 4 years ago #

    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!!

  2. vtxyzzy
    Member
    Posted 4 years ago #

    Add me to the list of those who would like to use custom post types.

  3. MrBeta
    Member
    Posted 4 years ago #

    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.

  4. MrBeta
    Member
    Posted 4 years ago #

    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.

  5. vtxyzzy
    Member
    Posted 4 years ago #

    Thanks for the tip!! Great work!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags