Actions

Descriptions

rtmedia_downloads_before_download_media


Action fire just before media will start download.

add_action( 'rtmedia_downloads_before_download_media', 'rtmedia_before_download_media', 10, 1 );

function rtmedia_before_download_media ( $download ) {

    // Restrict media download for subscriber and lower capablities users.

    if ( ! user_can( $download->interactor, 'edit_published_posts' ) ) {
        die('You can\'t download media..');
    }
}