Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#23617 closed defect (bug) (fixed)

Twenty Ten: retrofit with "get first gallery image" technique for gallery post format

Reported by: lancewillett's profile lancewillett Owned by: lancewillett's profile lancewillett
Milestone: 3.6 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

The goal is to replace the custom code in loop.php with a simpler, cleaner core function. Will probably need to provide back compat fallback for pre 3.6 versions, though.

See #22960 for the new image grabber function and #15385 for converting Twenty Ten to using get_template_part().

Attachments (4)

23617.diff (1.7 KB) - added by obenland 11 years ago.
23617.1.diff (3.0 KB) - added by lancewillett 11 years ago.
Move to function, provide fallback for missing IDs
23617.2.diff (2.9 KB) - added by lancewillett 11 years ago.
23617.3.diff (635 bytes) - added by kovshenin 11 years ago.

Download all attachments as: .zip

Change History (17)

#1 @lancewillett
11 years ago

  • Milestone changed from WordPress.org to 3.6

@obenland
11 years ago

#2 @obenland
11 years ago

  • Keywords has-patch added; needs-patch removed

#3 @lancewillett
11 years ago

  • Keywords needs-testing added

My comment in http://core.trac.wordpress.org/ticket/22907#comment:4 applies here, too. What back compat do we need to test, and can the code be moved into a function to keep the template file cleaner?

#4 follow-up: @lancewillett
11 years ago

Quick test with 3.4.2 and Twenty Ten. Created a new gallery post, pasted in [gallery ids="619,618,617"] as the content (grabbed 3 IDs from Media Library).

Works great on index, no errors. On single, the view is empty, though.

Tested with 3.5.1 and Twenty Ten, same post content. Exact opposite result: looks great on single, but empty view on index.

#5 in reply to: ↑ 4 @lancewillett
11 years ago

Replying to lancewillett:

Tested with 3.5.1 and Twenty Ten, same post content. Exact opposite result: looks great on single, but empty view on index.

Scratch that, this was with 3.6 trunk latest.

#6 @lancewillett
11 years ago

  • Keywords needs-testing removed

Tests out great in 3.5.1 and 3.6 (previously I didn't have the patch attached correctly).

3.4.2 -- gallery is missing the images on single view (index looks fine).

Last edited 11 years ago by lancewillett (previous) (diff)

#7 @obenland
11 years ago

Patch doesn't tough the single view though. In 3.4 only images attached to the post were working with the gallery shortcode. The ability to add other pictures was just added in 3.5.

#8 @lancewillett
11 years ago

Cool. Works for me, then.

Thoughts on moving to a function instead of code right in the template?

@lancewillett
11 years ago

Move to function, provide fallback for missing IDs

#9 @lancewillett
11 years ago

.1 moves to functions.php to simplify the template file a bit, and provides better fallback for shortcodes without "ids" attributes.

#10 @lancewillett
11 years ago

.2 patch fixes comment block for accuracy for new function and changes function to always return an array value.

#11 @lancewillett
11 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In 23826:

Twenty Ten: improve how gallery image IDs are retrieved for use in the Gallery post format template. Props to obenland for original patch, fixes #23617.

@kovshenin
11 years ago

#12 @kovshenin
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

[24093] introduced a new $html argument to get_post_galleries which defaults to true and breaks gallery counts (displays always 1 without a thumbnail). 23617.3.diff addresses this, and also changes the function we check in function_exists to the one that is actually used.

#13 @lancewillett
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 24195:

Twenty Ten: call get_post_galleries() correctly now that it has new arguments, and use a more accurate function_exists call. Props kovshenin, closes #23617.

Note: See TracTickets for help on using tickets.