Plugin Directory

Changeset 1762988


Ignore:
Timestamp:
11/10/2017 01:45:39 PM (8 years ago)
Author:
webtimal
Message:

Post ID fix in shortcode handler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • multiple-cropped-images/trunk/dist/MCI_Usage.php

    r1753927 r1762988  
    4343                if($key !== false)
    4444                {
    45                     return $mci_entries[ $key ];
     45                    return $mci_entries[$key];
    4646                }
    4747            }
     
    6262            }
    6363
    64             $post_id = get_the_ID();
    65 
    6664            $atts = shortcode_atts([
    6765                'id'      => 0,
    68                 'post-id' => $post_id,
     66                'post-id' => get_the_ID(),
    6967                'size'    => 'cropped'
    7068            ], $atts);
     
    7270            if($atts['id'] > 0)
    7371            {
    74                 $mci_entry = MCI_Core::getMCIEntry($post_id, $atts['id']);
     72                $mci_entry = MCI_Core::getMCIEntry($atts['post-id'], $atts['id']);
    7573
    7674                if(empty($mci_entry))
     
    7977                }
    8078
    81 
    82                 $src       = isset($mci_entry[ $atts['size'] ]) ? $mci_entry[ $atts['size'] ] : $mci_entry['cropped'];
     79                $src       = isset($mci_entry[$atts['size']]) ? $mci_entry[$atts['size']] : $mci_entry['cropped'];
    8380                $seo_alt   = !empty($mci_entry['seo_alt']) ? ' alt="' . $mci_entry['seo_alt'] . '"' : '';
    8481                $seo_title = !empty($mci_entry['seo_title']) ? ' title="' . $mci_entry['seo_title'] . '"' : '';
Note: See TracChangeset for help on using the changeset viewer.