Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Custom MediaKnight download denied page
- */
- add_action( 'mediaknight_denied_download', function ( $attachment_id ) {
- ob_start( function ( $html ) {
- $request_uri = isset( $_SERVER['REQUEST_URI'] )
- ? wp_unslash( $_SERVER['REQUEST_URI'] )
- : '/';
- $login_url = wp_login_url( home_url( $request_uri ) );
- return '<!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Login Required - [WEBSITE NAME]</title>
- <style>
- * {
- box-sizing: border-box;
- }
- body {
- margin: 0;
- min-height: 100vh;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20px;
- background: #172b46;
- color: #26364c;
- font-family: Arial, sans-serif;
- }
- .access-message {
- width: 100%;
- max-width: 560px;
- padding: 50px 35px;
- text-align: center;
- background: #ffffff;
- border-radius: 12px;
- }
- .access-message h1 {
- margin: 0 0 18px;
- color: #172b46;
- font-size: 32px;
- }
- .access-message p {
- margin: 0 0 25px;
- font-size: 17px;
- line-height: 1.6;
- }
- .access-message a {
- display: inline-block;
- padding: 13px 25px;
- background: #172b46;
- color: #ffffff;
- text-decoration: none;
- font-weight: bold;
- border-radius: 6px;
- }
- .access-message a:hover {
- background: #304d70;
- }
- </style>
- </head>
- <body>
- <main class="access-message">
- <h1>Login Required</h1>
- <p>You must be logged in to your [WEBSITE NAME] account to download this file.</p>
- <a href="' . esc_url( $login_url ) . '">Log in to continue</a>
- </main>
- </body>
- </html>';
- } );
- }, PHP_INT_MAX );
Advertisement
Comments
-
- If you use the MediaKnight download protector plugin, you currently cannot alter the blocked download page. This is a temporary workaround for that issue.
Add Comment
Please, Sign In to add comment