Skip to content

Instantly share code, notes, and snippets.

@polevaultweb
Last active April 2, 2016 09:30
Show Gist options
  • Save polevaultweb/8d13b178d1fea22bd83c7e7d9ed97376 to your computer and use it in GitHub Desktop.
Save polevaultweb/8d13b178d1fea22bd83c7e7d9ed97376 to your computer and use it in GitHub Desktop.
WordPress Plugin to change Ninja Forms File Upload directory
<?php
/**
* Plugin Name: Ninja Forms File Uploads Directory Tweak
* Plugin URI: http://polevaultweb.com
* Description: Tweaks plugin
* Version: 1.0
* Author: polevaultweb
* Author URI: http://polevaultweb.com
*/
add_filter( 'ninja_forms_uploads_dir', 'nf_fu_dir_ninja_forms_uploads_dir' );
function nf_fu_dir_ninja_forms_uploads_dir( $dir ) {
$dir = str_replace( 'uploads/ninja-forms', 'plugins/s2member-files', $dir );
return $dir;
}
add_filter( 'ninja_forms_uploads_url', 'nf_fu_dir_ninja_forms_uploads_url' );
function nf_fu_dir_ninja_forms_uploads_url( $dir ) {
$dir = str_replace( 'uploads/ninja-forms', 'plugins/s2member-files', $dir );
return $dir;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment