Michal Pandyra
Forum Replies Created
-
Forum: Plugins
In reply to: [Flamingo] Deprecated Notice "add_object_page"The solution outlined by scherii does resolve the issue and should suffice until a compatible version of the plug-in is release.
I do want to note that, like the author noted, the warning notice does not generally not interfere with interference and is simply a nuisance that can be ignored, but it can pose problems under certain circumstances.
I came across an instance where a call to
wp_redirect
fails due to the fact that the notice has already printed output to the screen.Forum: Plugins
In reply to: [Flamingo] is this flamingo plugin Compatible with 4.5?Per another support thread here https://www.ads-software.com/support/topic/deprecated-notice-add_object_page
The only glaring incompatibility is that the plug-in currently uses a deprecated function to add its menu item to the admin dashboard navigation.
The fix suggested in the aforementioned post is enough to clear up the warning message and should be enough until an updated compatible version of the plug-in is released.
The biggest difference is that the menu item will likely pop down to the bottom of the menu, instead of appearing next to the CF7 menu item.
Forum: Plugins
In reply to: [Advanced Custom Fields: Link Picker Field] Incompatible with 4.2.1?I just came across this same issue. Clicking on the “Edit Link” button causes the page to refresh which makes it appear as though the dialog is opening and immediately closing.
I was able to resolve the issue by calling
preventDefault()
on the event immediately when the click is triggered. You’ll find it near the top of the /js/input.js file.Line 11, Changed:
var thisID = jQuery(this).attr("id");
To:
event.preventDefault();
var thisID = jQuery(this).attr("id");
EDIT:
I just noticed that other similar functions within the JavaScript accomplish this same thing following a slightly different methodology that utilizes a ternary operator. I’m assuming for backwards compatibility with older browsers.
In the interest of keeping this consistent, I’ve updated the code as follows.
event.preventDefault ? event.preventDefault() : event.returnValue = false;
var thisID = jQuery(this).attr("id");
Happy to help!
Thanks for bringing us such a great product! It definitely stays true to its namesake.
Forum: Hacks
In reply to: media_handle_sideload() not working, halts executionI had a similar issue in the past with media_handle_upload and I’ve recently had it happen to me again with this function.
You might be calling the function in a context where it has not been declared yet. This would cause the script to fatal error out. Try wrapping your code in a condition that checks if the function exists before calling it. If not, there are a few files that you’ll have to include.
The following might be a little excessive, but I’ve found that it adds all of the necessary file and media handling code that may otherwise not have been loaded. Note that it’s currently written for the media_handle_upload function, but you can easily replace it with media_handle_sideload
if ( !function_exists('media_handle_upload') ) { require_once(ABSPATH . "wp-admin" . '/includes/image.php'); require_once(ABSPATH . "wp-admin" . '/includes/file.php'); require_once(ABSPATH . "wp-admin" . '/includes/media.php'); }
Let me know if that works out for you! The code above comes second hand and I can no longer recall the original source, but thank you kind stranger… Wherever you are!