Including a 3rd party library in WordPress which needs to be accessible by wp-config

I’m attempting to use the Defuse encryption library in WordPress: https://github.com/defuse/php-encryption I’m using this guide as a resource for how to implement it: https://torquemag.io/2016/10/storing-encrypted-data-wordpress-database/ My question is, if my wp-config file requires access to a library, where should I put the library and require the file? Long description of problem: In the tutorial it says … Read more

How to get an image url from media library

I have got an attachment id, but I need an url. How can I get an url from the attachment object? // When an image is selected, run a callback. frame.on( ‘select’, function() { // Grab the selected attachment. var attachment = frame.state().get(‘selection’).first(); $(‘#’ + id).val(attachment.id); }); … toJSON() function convert it. Now it works. … Read more

Too much recursion error when chosing image from image library for two different meta boxes in one post

There must be a solution for this. I am using this solution for chooosing images from media library. http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/ THE PROBLEM: I am using two meta boxes for custom post type “products”. First consists of two metafields what is for adding two addition product pictures The second one is for creating a simple gallery for … Read more