Tag Info

New answers tagged

1

You can try adding the input file field once and using then using jQuery to add more fields when clicking add more. Here are the steps Register your setting using register_setting function Create Menu using add_menu_page. This also requires a calback function Add the thickbox and media-upload script using wp_enqueue_script and wp_enqueue_style Use the ...


2

In order to show new image dimension options in the WordPress admin media library you would need to use the image_size_names_choose filter to assign them a name. So the code in your functions.php should look something like this: if ( function_exists( 'add_image_size' ) ) { add_image_size( 'single-post-medium', 515 ); add_image_size( ...


0

You shouldn't assign a string valus to image. According to the example in this page, at first you must download files to temporary directory using download_url() and assign object returned by this function to $image: $image = download_url("http://yoursite.com/image01.jpg"); Don't forget to unlink() the $image at the end of function.


0

I found that there's a predefined WordPress function to upload a file into the Media Library but it's only working asynchronously with a <form> element and a $_FILES array. Second, I also found that there's a second imagepng() parameter filename which is the path where you want to save the file. I tried to save it to a WordPress uploads' path such ...


1

Use Wordpress defult media uploader and get uploaded link in jquery response it is quit easy <label for="upload_image"> <input id="upload_image" type="text" size="36" name="ad_image" value="http://" /> <input id="upload_image_button" class="button" type="button" value="Upload Image" /> <br />Enter a URL or upload an ...


0

I think, first of all you should move following filter outside the function and then check - add_filter( 'upload_mimes', array( 'JBLAB_Utils', 'images_upload_mimes' ) ); Even if it does not work, try changing the priority of the filter.


0

After an agonising search I found out that somehow the ms_files_rewriting option had been turned on. I've had it off since the install, but in progress of updating something it was set to 1 in db. Setting it back to 0 fixed the issue.


0

This line was missing from my .htaccess file, and I recovered it from a backup. I don't know if WP removed it during an upgrade or some other plugin did it, but replacing it fixed the problem: #uploaded files RewriteRule ^files/(..+) wp-includes/ms-files.php?file=$1 [L] Art Smith


0

Just add frame: 'post', to wp.media attributes.


2

I did similar thing recently but used the wp.media instead of ThickBox https://codex.wordpress.org/Javascript_Reference/wp.media with the same code from Codex. The only thing to make it work with multiple inputs is to move the frame variable from global scope to click function, so the 'frame' will be fresh for each click.


1

you have the "media_view_strings" filter for this : add_filter("media_view_strings", function ($strings, $post) { $strings["insertMediaTitle"] = "Upload Content"; $strings["uploadFilesTitle"] = "Upload"; $strings["mediaLibraryTitle"] = "Your Content"; return $strings; }, 10, 2);


0

Use the intermediate_image_sizes filter and return an empty array: add_filter( 'intermediate_image_sizes', '__return_empty_array' ); __return_empty_array is a helper function in WordPress, the above is all you need!


0

Mark Kaplan's modification to the question is correct. Media files can be either 'attached' to posts and needed by the site or can be referenced in a page link thus becoming an 'unattached' media files needed by the site. I have no plugin or programming solution but have used the following solution steps. 1. Scan the site with Screaming Frog SEO spider (or ...


5

I'm not 100% sure if I get your problem right, but... Maybe this will help you... Media uploader gets attachments with simple WP_Query, so you can use many filters to modify it's contents. The only problem is that you can't query posts with specific CPT as parent using WP_Query arguments... So, we will have to use posts_where and posts_join filters. To be ...


0

Marketplace is rather void of a plugin to enhance this workflow. My designer team wants to clip random parts of any page, which means copy as URL etc aren't going to do the job. I'm sort of surprised this isn't in the core yet. https://wordpress.org/plugins/image-elevator/ seems to be the most trustworthy choice so far. Another plugin, Imagepaste, looks ...


0

According to WordPress Codex you can add custom tab in media uploader like this: // add the tab add_filter('media_upload_tabs', 'my_upload_tab'); function my_upload_tab($tabs) { $tabs['mytabname'] = "My Tab Name"; return $tabs; } // call the new tab with wp_iframe add_action('media_upload_mytabname', 'add_my_new_form'); function add_my_new_form() { ...


-1

function axcoto_genify_media_menu($tabs) { $newtab = array('genify' => __('Axcoto Genify', 'axcotogenify')); return array_merge($tabs, $newtab); } add_filter('media_upload_tabs', 'axcoto_genify_media_menu'); array('genify' => __('Axcoto Genify', 'axcotogenify')); function ...


2

WordPress provides a function called unzip_file()-- easily found by typing "wordpress unzip" into Google. There is sample code in the Codex: WP_Filesystem(); $destination = wp_upload_dir(); $destination_path = $destination['path']; $unzipfile = unzip_file( $destination_path.'/filename.zip', $destination_path); if ( $unzipfile ) { echo 'Successfully ...



Top 50 recent answers are included