Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • iamwaggle

    (@iamwaggle)

    Hey Martin!

    I say give the user the option to maintain or remove the remaining post thumbnails if they exist. That way the user can prep their images in the media library by date. The following code is just meant to be illustrative. Again, great plugin. I just thought this would be a cool feature. No offense intended! 🙂

    Best,
    Justin

    $remove_featured_images_in_excess = 1; // this variable to be set as an option on the admin side of your plugin
    
    if($index <= $last_index){
    
      // set featured image id
      $thumb_id = $this->selected_multiple_image_ids[ $index ]; //changed
      $index++; //new
      // do the task
      $success = set_post_thumbnail( $post_id, $thumb_id );
    
    }else if($remove_featured_images_in_excess){
      $success = delete_post_thumbnail( $post_id );
    }
    iamwaggle

    (@iamwaggle)

    Hey Martin!

    I just wanted to jump in and request a feature. A made a modification of your plugin to achieve my goal of a separate image for each post (no repeats). I was just thinking this would be a great addition and pretty easy to implement. Great plugin! Thanks for all your work on it!

    Best,
    Justin

    quick-featured-images/admin/class-quick-featured-images-tools.php

    case 'assign_randomly':
    						$last_index = count( $this->selected_multiple_image_ids ) - 1;
    						$do_overwriting = in_array( 'overwrite', $this->selected_options );
    						$orphans_only = in_array( 'orphans_only', $this->selected_options );
    						$index = 0; // new
    						while ( $the_query->have_posts() ) {
    							$the_query->the_post();
    							$success = false;
    							// get the post id once
    							$post_id = get_the_ID();
    							// check if there is an existing featured image
    							$thumb_id = get_post_thumbnail_id( $post_id );
    							// if post with featured images should be ignored, jump to next loop
    							if ( $thumb_id and $orphans_only ) {
    								continue;
    							}
    							// if no existing featured image or if permission to overwrite it
    							if ( ! $thumb_id or $do_overwriting ) {
    								// set featured image id
    								$thumb_id = $this->selected_multiple_image_ids[ $index ]; //changed
    								$index++; //new
    								// do the task
    								$success = set_post_thumbnail( $post_id, $thumb_id );
    							}
    Forum: Plugins
    In reply to: Malware?

    I believe I fixed my issue by updating the timthumb.php file in my theme. Ultimately I had to change the ownership of the files to “apache” and change the settings from “777” to “755”. I also re-installed my theme all together. I hope this helps!

    Forum: Plugins
    In reply to: Malware?

    Same issue for me!

Viewing 4 replies - 1 through 4 (of 4 total)