Changeset 3265913
- Timestamp:
- 04/02/2025 09:39:06 PM (9 months ago)
- Location:
- automatic-featured-images-from-videos
- Files:
-
- 9 added
- 5 edited
-
tags/1.2.5 (added)
-
tags/1.2.5/automatic-featured-images-from-videos.php (added)
-
tags/1.2.5/includes (added)
-
tags/1.2.5/includes/ajax.php (added)
-
tags/1.2.5/includes/bulk-operations.php (added)
-
tags/1.2.5/includes/cli.php (added)
-
tags/1.2.5/js (added)
-
tags/1.2.5/js/button.js (added)
-
tags/1.2.5/readme.txt (added)
-
trunk/automatic-featured-images-from-videos.php (modified) (1 diff)
-
trunk/includes/ajax.php (modified) (1 diff)
-
trunk/includes/bulk-operations.php (modified) (3 diffs)
-
trunk/js/button.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
automatic-featured-images-from-videos/trunk/automatic-featured-images-from-videos.php
r3148865 r3265913 4 4 * Plugin URI: https://webdevstudios.com 5 5 * Description: If a YouTube or Vimeo video exists in the first few paragraphs of a post, automatically set the post's featured image to that video's thumbnail. 6 * Version: 1.2. 46 * Version: 1.2.5 7 7 * Author: WebDevStudios 8 8 * Author URI: https://webdevstudios.com -
automatic-featured-images-from-videos/trunk/includes/ajax.php
r2984965 r3265913 22 22 23 23 // Allow developers to pass in custom CPTs to process. 24 $type_array = apply_filters( 'wds_featured_images_from_video_post_types', array( 'post', 'page' ));24 $type_array = apply_filters( 'wds_featured_images_from_video_post_types', [ 'post', 'page' ] ); 25 25 26 26 if ( is_array( $type_array ) && in_array( $post_type, $type_array ) ) { 27 $args = array(27 $args = [ 28 28 'post_type' => $post_type, 29 29 'status' => wds_featured_images_from_video_processing_status( $post_type ), 30 30 'processing_text' => wds_featured_images_from_video_processing_current_disposition(), 31 31 'bulk_text' => esc_html__( 'Bulk add video thumbnails', 'wds_automatic_featured_images_from_videos' ), 32 ); 32 'nonce' => wp_create_nonce( 'wdsafi-ajax-nonce' ) 33 ]; 33 34 34 35 wp_localize_script( 'wds_featured_images_from_video_script', 'wds_featured_image_from_vid_args', $args ); -
automatic-featured-images-from-videos/trunk/includes/bulk-operations.php
r1834150 r3265913 16 16 function wds_queue_bulk_processing() { 17 17 18 if ( empty( $_POST['wdsafi_nonce'] ) || ! wp_verify_nonce( $_POST['wdsafi_nonce'], 'wdsafi-ajax-nonce' ) ) { 19 wp_die( esc_html__( 'Nonce failure', 'automatic-featured-images-from-videos' ) ); 20 } 21 18 22 /** 19 23 * Allow developers to pass in custom post types to process. … … 23 27 * @param array $value Array of post types to process. 24 28 */ 25 $type_array = apply_filters( 'wds_featured_images_from_video_post_types', array( 'post', 'page' ));29 $type_array = apply_filters( 'wds_featured_images_from_video_post_types', [ 'post', 'page' ] ); 26 30 27 31 if ( ! in_array( $_POST['posttype'], $type_array ) ) { 28 32 return; 29 33 } 30 wp_schedule_single_event( time() + 60, 'wds_bulk_process_video_query_init', array( $_POST['posttype'] ));34 wp_schedule_single_event( time() + 60, 'wds_bulk_process_video_query_init', [ $_POST['posttype'] ] ); 31 35 } 32 36 … … 58 62 $reschedule_task = wds_automatic_featured_images_from_videos_wp_query( $post_type, $posts_to_process ); 59 63 if ( $reschedule_task->post_count > 1 ) { 60 wp_schedule_single_event( time() + ( 60 * 10 ), 'wds_bulk_process_video_query_init', array( $post_type ));64 wp_schedule_single_event( time() + ( 60 * 10 ), 'wds_bulk_process_video_query_init', [ $post_type ] ); 61 65 } 62 66 } -
automatic-featured-images-from-videos/trunk/js/button.js
r1834150 r3265913 14 14 type: "POST", 15 15 url : ajaxurl, 16 data: {action: 'wds_queue_bulk_processing', posttype: wds_featured_image_from_vid_args.post_type} 16 data: { 17 action : 'wds_queue_bulk_processing', 18 posttype : wds_featured_image_from_vid_args.post_type, 19 wdsafi_nonce: wds_featured_image_from_vid_args.nonce, 20 } 17 21 }); 18 22 }); -
automatic-featured-images-from-videos/trunk/readme.txt
r3148865 r3265913 5 5 Tags: video, youtube, vimeo, featured image 6 6 Requires at least: 5.0 7 Tested up to: 6. 6.18 Stable tag: 1.2. 47 Tested up to: 6.7.2 8 Stable tag: 1.2.5 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 40 40 41 41 == Changelog == 42 43 = 1.2.5 = 44 * Updated: added nonce verification to bulk processing cron scheduling request. 42 45 43 46 = 1.2.4 =
Note: See TracChangeset
for help on using the changeset viewer.