Tag Info

New answers tagged

0

I founded the solution... all it's a problem with a JS function called "slideUp" in my ajax.js (ajax's functions for my front-end site) I don't know the reason, but when I try to upload or a media file, Wordpress try to execute this function. I change his name and the "$" for "jQuery" and now it's works correctly. Thanks for the help!


0

If your theme has an attachment template (attachment.php) and you upload your page/post-specific media items, then you will get a page/post-specific media attachment URL. Suppose you are adding/editing your post/page on Case Study (i.e. cs1), so your post/page URL will be (if post-name permalink structure is enabled): http://example.com/cs1/ If you ...


0

Your Nginx website conf should look like that: location /wordpress { try_files $uri $uri/ /wordpress/index.php?$args; } This will allow all paths who doesn't match a real file to be redirected to the index.php with the query sting passed directly to Wordpress. Wordpress will handle it from there. More in depth information can be found here: ...


1

I presume you've fixed this already but (in a blatant attempt to snaffle the bounty and) as mentioned in the comments there's a simple fix, in your myplugin_meta_box_callback() function change the line $mime_types = array( 'application/pdf' ); to $mime_types = 'application/pdf'; The library.type option to wp.media expects a string (which can ...


0

Thanks @shady-m-rasmy I used the code you mentionned, and it seems that the second foreach loop (below - in the custom template part) is not necessary as it is only executed once. foreach ($_FILES as $file => $array) { $newupload = my_handle_attachment($file,$pid); } So it only leaves with $newupload = my_handle_attachment( ...


4

WP sanitize_file_name() function doesn't handle those characters by default. You can add filter and sanitize those to avoid encoding issues. function mamaduka_sanitize_file_name( $filename ) { $filename = strtr($filename, ...


1

There isn't much point to distinguishing admin-ajax.php since it's essentially same file with same logic running for many many purposes. You are passing action data and hooking into respective action. So action is your identifier. If you are reusing same action and need to further differentiate — just pass more data with your GET/POST request and check for ...


0

I found it and its work great for me, I used the solution in this answer to solve my problem but I'll not chose my answer as a correct answer because the solution in that question uses this function media_handle_sideload, even if WordPress codex told that this function work like the media_handle_upload function. but I'll wait until someone give me the answer ...


0

code from my theme adjusted to you <fieldset class="images"> <input type="file" name="my_file_upload[]" id="my_file_upload[]" multiple="multiple"> </fieldset> <fieldset class="memes"> <input type="file" name="my_file_upload[]" id="my_file_upload[]" multiple="multiple"> </filedset> and its working



Top 50 recent answers are included