Tag Info

New answers tagged

0

you can solve this problem by enqueue the following script with the dependency of jQuery jQuery(document).ready(function(){ tinyMCEPreInit.dragDropUpload = false; }); To add the dependency you can refer this link I have tested this solution and it has worked for me. I hope it will work for you too.


0

From your question what i understood is u need to store media files to another custom location. if that is your doubt then this may help you.. In order to change the default media upload location, you need to edit the wp-config.php file. If you want upload directory to be wp-content/example then you will need to place the following code in wp-config.php ...


1

Just as an addition, as an improvement to account for different image sizes, I would do: $file_name = pathinfo( $file, PATHINFO_FILENAME ); $file_extension = '.' . pathinfo( $file, PATHINFO_EXTENSION ); Instead having a combined value for $file. And change the SQL preparation to: $prepared_sql = $wpdb->prepare( $sql, $id, ...


3

Second pass. Known issues: Needs caching (and the cache needs to be tidied up where possible) Post types are hard-coded Which post statuses are we interested in? Here's the function: /** * Given an attachment ID, searches for any post with that attachment used * as a featured image, or if it is present in the content of the post. * (Note above known ...


0

Perhaps a bit late answer, but I had a similar scenario and wanted to share the solution. In functions.php of the theme (creating a plugin would work as well), I used the 'add_attachment' hook to create a new post (custom post type 'talk') based on each new uploaded file. Of course, the example could do with a bit of shining up, but this worked for parsing ...


0

I know this is an old question, but I believe this answer is better suited now, as WordPress does now allow you to hook into this. The default image size, align and "link to" properties for inserting an image are set through the options image_default_size, image_default_link_type and image_default_align, respectively. You can change this beahviour in a ...



Top 50 recent answers are included