Run command to optimize images after they get uploaded to WordPress
Run command to optimize images after they get uploaded to WordPress
Run command to optimize images after they get uploaded to WordPress
Your actual issue is that you are using $(‘.custom_media_url’).val(attachment.url); without selecting the exact field you need. This selects every .custom_media_url field on the page, e.g. each field within each widget. Since you are using jQuery, you can replace this line: $(‘.custom_media_url’).val(attachment.url); with $( e.target ).siblings( ‘.custom_media_url’ ).val( attachment.url ) However, using wp.media.editor is not the … Read more
Uploading a file results in attachment post, but file is missing
I have a partial solution where I can add a image crop uploader to the theme customization page. I have yet to figure out how to attach it to acf. function add_my_media_controls($wp_customize) { $wp_customize->add_section( ‘theme_banner_image’, array( ‘title’ => __( ‘Banner Image’, ‘theme_banner_image’ ), ‘priority’ => 35, ) ); $wp_customize->add_setting(‘banner_image’, array( ‘type’ => ‘theme_mod’, ‘capability’ => … Read more
thanks to both of you who answered. The problem turned out to be that there are more than one rows in wp_options which refer to the uploads folder: upload_path, upload_url_path and fileupload_url – I had only found one of these when I searched “upload_url” and missed the first one, which was of course pointing to … Read more
I’m afraid you’ll also need to create the database records – that’s how WP looks for media files, starting in the db. Those records then tell WP the local path to the media file. But that means that if your web server has access to both sub domain folders on disk, you don’t need to … Read more
I suggest you search on Github for a plugin that’ll suit your needs. A quick search lead me to wp-file-upload
No it’s not. Unless you have a connection that is being interrupted, or is very slow. Here is what you can do: Option 1 Increase the PHP max execution time. Ask your host provider to increase it, or if you have access to it, update this line in your php.ini file: max_execution_time = 999 Option … Read more
maybe validate_user_storage_space is firing too early or its too late. try wrapping this function inside another function then hook second function with one of below action hook init or after_setup_theme or plugins_loaded like below. add_action( ‘init’, ‘validate_user_init’ ); //after_setup_theme plugins_loaded function validate_user_init(){ add_filter(‘wp_handle_upload_prefilter’, ‘validate_user_storage_space’, 1); add_filter(‘wp_handle_sideload_prefilter’, ‘validate_user_storage_space’, 1); } function validate_user_storage_space( $file ) { //your … Read more
If frame is an instance of wp.media, frame.detach() does the job for me.