Changeset 1159681
- Timestamp:
- 05/13/2015 02:17:00 PM (11 years ago)
- Location:
- foogallery-captions/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (2 diffs)
-
foogallery-individual-captions.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
foogallery-captions/trunk/README.txt
r1152687 r1159681 5 5 Requires at least: 4.0 6 6 Tested up to: 4.2.1 7 Stable tag: 1.07 Stable tag: trunk 8 8 License: GPLv2 or later 9 9 … … 33 33 == Changelog == 34 34 35 = 1.0.1 = 36 * Fixes the stupidest fatal error ever! 37 35 38 = 1.0.0 = 36 39 * Initial plugin -
foogallery-captions/trunk/foogallery-individual-captions.php
r1152687 r1159681 30 30 */ 31 31 32 if ( is_plugin_active( 'foogallery/foogallery.php' ) ) { 32 33 33 34 34 /** … … 42 42 */ 43 43 public static function init() { 44 45 if(!class_exists('FooGallery_Plugin')) { 46 return; 47 } 44 48 45 49 add_action( 'admin_enqueue_scripts', array( 'FooGalleryCaptions', 'scripts' ) ); … … 109 113 $captions = get_post_meta( $post->ID, 'foogallery_captions', true ); 110 114 111 foreach($captions as $attachment => $caption) { 112 foreach($caption as $key => $value) { 113 echo '<input type="hidden" id="foogallery-captions-'. $attachment .'-'. $key .'" name="foogallery_captions['. $attachment .']['. $key .']" value="'. $value .'" />'; 115 if($captions) { 116 foreach($captions as $attachment => $caption) { 117 foreach($caption as $key => $value) { 118 echo '<input type="hidden" id="foogallery-captions-'. $attachment .'-'. $key .'" name="foogallery_captions['. $attachment .']['. $key .']" value="'. $value .'" />'; 119 } 114 120 } 115 121 } … … 182 188 */ 183 189 public static function get_captions($post, $attachment) { 190 191 $post = apply_filters('foogallery_captions_post_id', $post); 192 $attachment = apply_filters('foogallery_captions_attachment_id', $attachment, $post); 193 184 194 $captions = get_post_meta( $post, 'foogallery_captions', true ); 185 195 … … 223 233 $caption = self::get_captions($current_foogallery->ID, $obj->ID); 224 234 225 $attr['data-caption-title'] = $caption[' title'];235 $attr['data-caption-title'] = $caption['caption']; 226 236 $attr['data-caption-desc'] = $caption['description']; 227 237 } … … 233 243 add_action( 'plugins_loaded', array( 'FooGalleryCaptions', 'init' ) ); 234 244 235 } 245
Note: See TracChangeset
for help on using the changeset viewer.