Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development still active? Error 404 even for logged-in users. #3

Open
webdados opened this issue Jan 2, 2017 · 1 comment
Open

Comments

@webdados
Copy link

webdados commented Jan 2, 2017

Is the development of this plugin still active?

I'm using WordPress 4.7 and I'm getting 404 errors even for logged-in users.

@webdados
Copy link
Author

webdados commented Jan 2, 2017

The problem is the rewrite rule created, that assumes the folder is "content/uploads".

The rewrite_rules method should be changed to:

`
function rewrite_rules() {

$uploads = wp_upload_dir();
$base_url = parse_url($uploads['baseurl']);
$base_url = trim($base_url['path'],' /');

hm_add_rewrite_rule( array(
	'regex' => '^'.$base_url.'/private-files/([^*]+)/([^*]+)?$',
	'query' => 'file_id=$matches[1]&file_name=$matches[2]',
	'request_method' => 'get',
	'request_callback' => array( $this, 'rewrite_callback' )
) );

}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant