• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Plugins » Download Protect » Download Protect Documentation » Filter Hooks » wpmem_dp_download_header_args

wpmem_dp_download_header_args

Description

Allows you to filter whether the user can download or not.

Parameters

$args
(array)(required) An array of arguments passed from handle_download().

$args => array (

‘description’ => ‘File Transfer’,
‘type’ => ‘application/pdf’, // OR ‘application/octet-stream’,
‘disposition’ => ‘inline’, // OR ‘attachment’,
‘filename’ => $filepath_basename,
‘encoding’ => ‘binary’,
‘expires’ => 0,
‘cache-control’ => ‘must-revalidate’,
‘pragma’ => ‘public’,
‘length’ => $the_file_size,

)

Usage

add_filter( 'wpmem_dp_download_header_args', 'my_dp_download_header_args' );
function my_dp_download_header_args( $args ) {
    
    /*
     * This example changes PDF mime type to "octet-stream"
     * so will download rather than open in a browser.
     */
    $args['type'] = "application/octet-stream";
    
    return $args;
}

Changelog

  • Introduced in 1.4.0

Source

wpmem_block is located in includes/class-wp-members-download-protect.php

WP-Members Download Protect

Plugin Info

Current Stable Version: 1.9.9
Minimum WordPress Version: 5.0
Tested up to WordPress Version: 6.6
Last Updated: 2024-10-17

Documentation

    • Installation
    • Settings
    • Upload Files
    • Download Tracking
    • Shortcodes
    • Filter Hooks
    • WP CLI Commands
    • FAQs
    • Change Log

Get the Plugin

  • Purchase the Plugin
  • Get the Pro Bundle

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy