This file contains hidden or 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 | |
/** | |
* Create a POST Webhook action with one arg, the key of 'cv_file_attach' and value of '{field:cv_file_attach:url}' | |
* Change the key and value to suit the File Upload field. Change the key in the code below. | |
*/ | |
add_filter( 'nf_remote_post_args', function ( $args ) { | |
if ( ! isset( $args['body']['cv_file_attach'] ) ) { | |
return $args; | |
} |
This file contains hidden or 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 | |
add_filter( 'pre_update_option_wp-oauth2-tokens', function ( $value, $old_value ) { | |
if ( empty( $old_value['google'] ) ) { | |
// Google not connected | |
return $value; | |
} | |
if ( ! empty( $old_value['google'] ) && ! empty( $value['google'] ) ) { | |
// Google still connected | |
return $value; |
This file contains hidden or 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 | |
add_filter( 'wpum_upload_file_pre_upload', 'wpum_resize_avatar_images', 10, 2 ); | |
function wpum_resize_avatar_images( $file, $args ) { | |
if ( ! isset( $args['file_key'] ) || 'user_avatar' !== $args['file_key'] ) { | |
return $file; | |
} | |
$editor = wp_get_image_editor( $file['tmp_name'] ); | |
if ( is_wp_error( $editor ) ) { |
This file contains hidden or 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 | |
add_filter( 'wp_redirect', function ( $location ) { | |
if ( ! isset( $_POST['wpum_form'] ) || 'profile' !== $_POST['wpum_form'] ) { | |
return $location; | |
} | |
if ( empty( $_POST['_wp_http_referer'] ) ) { | |
return $location; | |
} |
This file contains hidden or 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 | |
add_filter( 'ninja_forms_create_post_meta_value', 'my_ninja_forms_create_post_meta_value', 10, 3 ); | |
function my_ninja_forms_create_post_meta_value( $value, $post_type, $key ) { | |
if ( 'gallery' !== $key ) { // change this string to match your ACF field name | |
return $value; | |
} | |
return explode( ',', $value ); | |
} |
This file contains hidden or 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 | |
add_filter( 'ninja_forms_create_post_meta_value', 'my_ninja_forms_create_post_meta_value', 10, 3 ); | |
function my_ninja_forms_create_post_meta_value( $value, $post_type, $key ) { | |
if ( 'gallery' !== $key ) { // change this string to match your ACF field name | |
return $value; | |
} | |
return explode( ',', $value ); | |
} |
This file contains hidden or 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 | |
add_filter( 'ninja_forms_uploads_dropbox_filename', 'my_dropbox_filename', 10, 2 ); | |
function my_dropbox_filename( $filename, $original_filename ) { | |
return $original_filename; | |
} |
This file contains hidden or 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 | |
/** | |
* Plugin Name: Ninja Forms Uploads Debugger | |
* Plugin URI: https://ninjaforms.com/extensions/file-uploads/ | |
* Description: Debugger plugin | |
* Version: 3.0 | |
* Author: polevaultweb | |
* Author URI: https://polevaultweb.com | |
*/ |
This file contains hidden or 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 | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'dbi', 'slash-woo/', array( | |
'methods' => 'POST', | |
'callback' => 'slack_woo_command', | |
) ); | |
} ); | |
function slack_woo_command( $request ) { | |
$command = filter_input( INPUT_POST, 'command', FILTER_SANITIZE_STRING ); |
This file contains hidden or 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 | |
add_filter( 'wpmdb_process_column_as_binary', function( Bool $process_as_binary, stdClass $struct ) { | |
return ( true == $process_as_binary ) ? true : | |
in_array( strtolower( trim( $struct->Type ) ), [ | |
'geometry', | |
'point', | |
'linestring', | |
'polygon', | |
'multipoint', |