Changeset 1878326
- Timestamp:
- 05/21/2018 10:39:30 AM (8 years ago)
- Location:
- wp-auto-featured-image
- Files:
-
- 9 added
- 5 deleted
- 3 edited
-
tags/1.5/assets (deleted)
-
tags/1.5/branches (deleted)
-
tags/1.5/css (added)
-
tags/1.5/css/wafi-style.css (added)
-
tags/1.5/images (added)
-
tags/1.5/images/images.jpg (added)
-
tags/1.5/images/move.gif (added)
-
tags/1.5/js (added)
-
tags/1.5/js/wafi-script.js (added)
-
tags/1.5/readme.txt (added)
-
tags/1.5/tags (deleted)
-
tags/1.5/trunk (deleted)
-
tags/1.5/wp-auto-featured-image.php (added)
-
trunk/css/New folder (deleted)
-
trunk/js/wafi-script.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-auto-featured-image.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-auto-featured-image/trunk/js/wafi-script.js
r1416128 r1878326 15 15 }); 16 16 17 jQuery('#upload_default_thumb').click(function() { 18 upload_field_ID = jQuery(this).prev('input'); 19 form_field = jQuery('#default_thumb_url').attr( 'name' ); 20 tb_show('Upload Thumb', 'media-upload.php?referer=wp_afi&type=image&TB_iframe=true&post_id=0', false); 21 return false; 17 //jQuery('#upload_default_thumb').click(function(e) { 18 jQuery(document).on("click", "#upload_default_thumb", function (e) { 19 20 // Removed 21 May 2018 21 // upload_field_ID = jQuery(this).prev('input'); 22 // form_field = jQuery('#default_thumb_url').attr( 'name' ); 23 // tb_show('Upload Thumb', 'media-upload.php?referer=wp_afi&type=image&TB_iframe=true&post_id=0', false); 24 // return false; 25 // Added 21 May 2018 26 e.preventDefault(); 27 var file_frame = wp.media.frames.file_frame = wp.media({ 28 title: 'Select or upload image', 29 library: { // remove these to show all 30 type: 'image' // specific mime 31 }, 32 button: { 33 text: 'Set This My Default Thumbnail' 34 }, 35 multiple: false // Set to true to allow multiple files to be selected 36 }); 37 38 39 // When an image is selected, run a callback. 40 file_frame.on('select', function () { 41 // We set multiple to false so only get one image from the uploader 42 43 var attachment = file_frame.state().get('selection').first().toJSON(); 44 jQuery('#default_thumb_url').val(attachment.url); 45 jQuery('#default_thumb_id').val(attachment.id); 46 jQuery('#uploaded_thumb_preview img').attr('src',attachment.url); 47 jQuery('.button-primary').click(); 48 49 //$button.siblings('input').val(attachment.url).change(); 50 51 }); 52 53 // Finally, open the modal 54 file_frame.open(); 55 22 56 }); 23 57 58 /* 59 Removed 21 May 2018 24 60 window.send_to_editor = function(html) { 25 61 if (form_field) { … … 43 79 jQuery('#uploaded_thumb_preview img').attr('src',image_url); 44 80 jQuery('.button-primary').click(); 45 } 81 } */ 46 82 47 83 -
wp-auto-featured-image/trunk/readme.txt
r1410827 r1878326 3 3 Tags: Featured Image, Auto Featured Image, Default Featured Image, Auto, Default, Post Thumbnail, Auto Post Thumbnail, Set Post Thumbnail, Auto Post Thumbnail, WordPress Post Thumbnail 4 4 Donate link: https://sannysrivastava.wordpress.com 5 Requires at least: 3. 06 Tested up to: 4. 5.17 Stable tag: 1. 45 Requires at least: 3.5 6 Tested up to: 4.9.5 7 Stable tag: 1.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 == Frequently Asked Questions == 39 39 40 = Will this auto set thumbnail for all existing posts/pages? =40 = This plugin will set default thumbnail for all existing post-types/pages? = 41 41 42 This wil work for the post types you have configured from admin, it will work for newly cretaed or modified posts after your configuration from admin panel.42 This wil work for the post types you have configured from admin, it will work only for new or modified post-types/pages as per your configuration from admin panel. 43 43 44 = Can I choose specific post type for this? =44 = Can I choose specific multiple post type for a single default image? = 45 45 46 Yes, there is option from admin to set it for custom post types.46 Yes, you can. 47 47 48 = Can I choose custom image for default image? =48 = Can I choose different images for different post-types/categories? = 49 49 50 Yes, there is option from admin to set.50 No, right now there is no such feature available but you can hire experts from our team or can request a completely custom plugin as per your need. 51 51 52 52 == Changelog == 53 = 1.5 = 54 * Compatible upto 4.9.5 55 * Minor bug fix 56 53 57 = 1.4 = 54 58 * Compatible upto 4.5.1 -
wp-auto-featured-image/trunk/wp-auto-featured-image.php
r1410827 r1878326 8 8 * License: GPLv2 or later 9 9 * License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 * Version: 1. 410 * Version: 1.5 11 11 12 12 Copyright (c) 2014 by Sanny Srivastava (sannysrivastava@gmail.com) … … 247 247 if('settings_page_wp_auto_featured_image' == get_current_screen()->id) { 248 248 wp_enqueue_script('jquery'); 249 wp_enqueue_script('thickbox'); 250 wp_enqueue_style('thickbox'); 251 wp_enqueue_script('media-upload'); 249 // wp_enqueue_script('thickbox'); Removed 21 May 2018 250 // wp_enqueue_style('thickbox'); Removed 21 May 2018 251 wp_enqueue_script( 'media-upload' ); 252 wp_enqueue_media(); // Added 21 May 2018 252 253 wp_enqueue_script('wafi-script'); 253 254 } … … 270 271 # Check if this suppose to be set thumbnail. 271 272 if((!empty($options['wpafi_post_type'])) && (is_array($options['wpafi_post_type'])) && (in_array($post_type, $options['wpafi_post_type']) != 0) && (has_post_thumbnail( $post_id ) == false)) { 272 273 //die('============== S A N N Y =================='); 273 274 # If category filter is on. 274 275 if((is_array($options['wpafi_categories'])) && ($post_type != 'page')){ … … 293 294 } 294 295 296 /* 297 Removed 21 May 2018 295 298 function wedevs_send_to_editor( $html, $id ) { 296 299 return str_replace( '<a href', '<a data-id="' . $id . '" href', $html ); 297 300 } 298 301 299 add_filter( 'image_send_to_editor', 'wedevs_send_to_editor', 10, 2 ); 302 add_filter( 'image_send_to_editor', 'wedevs_send_to_editor', 10, 2 );*/ 300 303 301 304 302 305 # Custom button text for INSERT MEDIA button 306 /* 307 Removed 21 May 2018 303 308 add_action( 'admin_init', 'wpfi_custom_button_text' ); 304 309 function wpfi_custom_button_text() { … … 317 322 } 318 323 return $translated_text; 319 } 324 }*/
Note: See TracChangeset
for help on using the changeset viewer.