Tag Info

Hot answers tagged

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 ...


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( ...


2

One way to do it (which is probably evil) is to select the control by adding a block of javascript using the tr field of $form_fields: function set_image_data( $form_fields, $post ) { $form_fields['text_color'] = array( 'label' => 'Text Color', 'input' => 'text', 'value' => get_post_meta( $post->ID, '_text_color', ...


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 ...


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 ...


1

Where in core ? These parts here and here, are responsible for overriding the image title with meta data: // ... cut ... // Use image exif/iptc data for title and caption defaults if possible. } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) { if ( trim( ...


1

I can only take a guess at this. Is the image you want to change a background image (using CSS)? - if you goto the page, use your web inspector tool. You should then be able to see where image url is coming from.


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);



Only top voted, non community-wiki answers of a minimum length are eligible