Plugin Directory

Changeset 391166


Ignore:
Timestamp:
05/31/2011 09:47:56 AM (15 years ago)
Author:
johannesfosseus
Message:

update 1.2.2, fixed Quick Edit bug

Location:
related-images
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • related-images/trunk/readme.txt

    r389312 r391166  
    1515Version 1.0 only have 4 positions (top_firstpage,right_firstpage,left_firstpage,top_article), this will be moved to a config in the future for better use.
    1616
     17Update: fron version 1.2 you can create your positions yourself
     18
    1719== Installation ==
    1820
     
    2426
    2527== Changelog ==
     28
     29= 1.2.2 =
     30* bugfix, wrong post version number used
    2631
    2732= 1.2.1 =
  • related-images/trunk/related-images.class.php

    r389263 r391166  
    8787        global $wpdb;
    8888
     89        // save to the correct post_id
     90        $post_id = get_post($post_id)->post_parent;
     91
    8992        // get saved positions
    9093        if($_POST['saved_img_position']){
     
    105108        }
    106109
    107         // check if we have any positions at all
    108         $len = sizeof($cleaned);
    109 
    110         // if we do, save or not
    111         if($len > 0){
    112             update_option($post_id."_related_images", $cleaned);
    113         } else {
    114             delete_option($post_id."_related_images");
     110        // do not save if arr not exits, for example in the Quick "Edit"
     111        if($cleaned){
     112
     113            // check if we have any positions at all
     114            $len = sizeof($cleaned);
     115
     116            // if we do, save or not
     117            if($len > 0){
     118                update_option($post_id."_related_images", $cleaned);
     119            } else {
     120                delete_option($post_id."_related_images");
     121            }
     122
    115123        }
    116124
Note: See TracChangeset for help on using the changeset viewer.