Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Hemberger committed Mar 16, 2018
2 parents 28bdc6d + 9db860b commit 427e266
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Changelog

#### 1.1.1 (3/16/18)
* Fixed: Upload prefilter priority args missing causing HTTP errors when uploading files.

#### 1.1.0
* Changed: Initial name change from Protected PDFs to Wampum Protected Media.

#### 1.0.5
* Changed: Don't swap iframe src if opening the same pdf that is already loaded.

Expand Down
9 changes: 6 additions & 3 deletions wampum-protected-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Wampum - Protected Media
* Plugin URI: https://bizbudding.com
* Description: Attach PDFs to pages/posts/cpts that can only be viewed from the pages they are attached to (via PDF.js). Requires Genesis for file display and ACF Pro for the files metabox.
* Version: 1.1.0
* Version: 1.1.1
*
* Author: Mike Hemberger, BizBudding
* Author URI: https://bizbudding.com
Expand Down Expand Up @@ -98,7 +98,7 @@ private function setup_constants() {

// Plugin version.
if ( ! defined( 'WAMPUM_PROTECTED_MEDIA_VERSION' ) ) {
define( 'WAMPUM_PROTECTED_MEDIA_VERSION', '1.1.0' );
define( 'WAMPUM_PROTECTED_MEDIA_VERSION', '1.1.1' );
}

// Plugin Folder Path.
Expand Down Expand Up @@ -155,7 +155,7 @@ public function activate() {
}

public function filters() {
add_filter( 'acf/upload_prefilter/key=field_59ee1e45dc4b8', array( $this, 'upload_prefilter' ) );
add_filter( 'acf/upload_prefilter/key=field_59ee1e45dc4b8', array( $this, 'upload_prefilter' ), 10, 3 );
add_filter( 'acf/validate_value/key=field_59ee1e45dc4b8', array( $this, 'validate_value' ), 10, 4 );
}

Expand Down Expand Up @@ -257,12 +257,14 @@ public function upload_prefilter( $errors, $file, $field ) {
return $errors;
}

// Build the upload directory name.
public function upload_directory( $param ){
$param['path'] = $param['basedir'] . '/' . $this->directory_name;
$param['url'] = $param['baseurl'] . '/' . $this->directory_name;
return $param;
}

// Make sure the upload is in the right directory.
public function validate_value( $valid, $value, $field, $input ){
// Bail if already invalid.
if( ! $valid ) {
Expand All @@ -278,6 +280,7 @@ public function validate_value( $valid, $value, $field, $input ){
return $valid;
}

// Display the file list.
public function display() {

// Bail if not a post type for ppdfs.
Expand Down

0 comments on commit 427e266

Please sign in to comment.