Missing a temporary folder despite settings in wp-config.php

try to use get_temp_dir() to see if wordpress is using your WP_TEMP_DIR constant. i’ve tried this code in wp-config.php and it works define(‘WP_TEMP_DIR’, dirname(__FILE__) . ‘/wp-content/temp/’); but you have to put it before the /* That’s all, stop editing! Happy blogging. */ in your wp-config.php file.

Is it possible to trigger some JavaScript when Media Popup is opened?

You can use several event handlers. frame.on(‘open’,function() { // Do something }); frame.on(‘close’,function() { // Do something }); frame.on(‘select’,function() { // Do something }); Where frame is a reference to wp.media() frame = wp.media(); frame.on(‘select’,function() { // Do something }); Full example Script en-queued with jQuery and media editor as dependencies. function media_script_enqueue() { wp_enqueue_script( … Read more

Large Uploads in WordPress

70-80MB is really not that large. Easily handled by the Flash uploader if your server is properly configured. Hell, I have a 2 gigabyte upload limit on my site. 🙂 When they’re writing the new “post”, they just click the add media button above the toolbar and upload it. It gets saved as an attachment … Read more

How do I link directly to uploaded files?

If I upload the file to WordPress’ upload directory through FTP, I don’t see the file show up in my media (in WP-admin) Try to avoid directly uploading via FTP. WordPress doesn’t scan your uploads folder for new images. Instead, use the built-in media uploader within WordPress to upload images. WordPress will automatically place them … Read more

How to add image uploader to a custom widget?

Firstly, it is not recommended to use WP_PLUGIN_URL constant, instead use plugins_url() function. Second thing, it will not work when you put your files in the theme. You must put the necessary folder and file in the plugin if have to use this constant or function. Make sure, you have put correct path and you … Read more

How to set an upload directory for each media type?

[More info added]. See below the code. //~ change upload dir add_filter(‘upload_dir’, ‘choose_upload_dir’); //~ upload image $upload = wp_handle_upload( $_FILES[‘your_form_input_name’], array(‘test_form’ => false) ); //~ change upload dir back remove_filter(‘upload_dir’, ‘choose_upload_dir’); function choose_upload_dir($upload) { //~ your file to upload $file_type = $_FILES[‘your_form_input_name’][‘type’]; //~ switch between file types switch($file_type) { //~ if type is ‘png’ then … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)