Created
November 11, 2018 01:37
-
-
Save tokkonopapa/49470fdd3f4f7b9a996c7e8341ccc16e to your computer and use it in GitHub Desktop.
Give permission to upload any files when administrator uses Elementor Page Builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Drop-in for IP Geo Block custom filters for admin | |
* | |
* This file should be named as `drop-in-admin.php`. | |
* | |
* @package IP_Geo_Block | |
* @author tokkonopapa <[email protected]> | |
* @license GPL-3.0 | |
* @link http://www.ipgeoblock.com/ | |
* @see http://www.ipgeoblock.com/codex/#filter-hooks | |
* @example Use `IP_Geo_Block::add_filter()` instead of `add_filter()` | |
*/ | |
class_exists( 'IP_Geo_Block', FALSE ) or die; | |
/** | |
* Handle uploaded files when fobidden MIME type is detected. | |
* | |
* @param array $validate validation result | |
* @return array $validate validation result | |
*/ | |
function my_upload_forbidden( $validate ) { | |
// Check authority and existence of specific plugin | |
if ( $validate['auth'] && defined( 'ELEMENTOR_PLUGIN_BASE' ) ) { | |
unset( $validate['upload'], $validate['result'] ); | |
} | |
return $validate; | |
} | |
IP_Geo_Block::add_filter( "ip-geo-block-upload-forbidden", "my_upload_forbidden" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://wordpress.org/support/topic/form-not-sending-jquery-js/#post-10867441