Media not displaying other users uploads – WordPress 4.9.2
Media not displaying other users uploads – WordPress 4.9.2
Media not displaying other users uploads – WordPress 4.9.2
Serving cache from multiple domain names
problem when uploading file by metaboxes
wp.media – drag&drop overlay stuck
I was able to fix this problem by using this code instead of the one above: define(‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-content’); define(‘WP_CONTENT_URL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/wp-content’);
File was uploaded, but it is not shown on media section of the dashboard
I recommend using Search & Replace DB, a free tool by Interconnect, to replace any instances of the host name in the database. It will handle setting the serialized data correctly for you. First make sure that your wp-config is for the right database. You need to go into your new database and change the … Read more
Custom gallery displayin and sorting error
You could use admin-ajax.php to create a simple file proxy: add_action(‘wp_ajax_proxy_for_object1’, ‘proxy_for_object1’); add_action(‘wp_ajax_no_priv_proxy_for_object1’, ‘proxy_for_object1’); function proxy_for_object1() { $mimetype=””; // set to matching file MIME type header(“Content-type: “.$mimetype.”;”); echo file_get_contents(‘/wp-content/uploads/xx/thenameofmyfile.ext’); exit; } Then set the object resource URL to admin-ajax.php?action=proxy_for_object1 It will of course be fully accessible through the provided URL anyway, so this is really … Read more
Instead of custom curl HTTP request I’ll recommend you to use the wp_remote_post() or wp_remote_get() which internally call the HTTP request and handle all possible errors. Also use download_url() to download the file and media_handle_sideload() to upload the downloaded file into uploads directory.