Skip to content

Added extended shortcode attributes to entry_published #13

Closed
wants to merge 2 commits into from

4 participants

@developdaly

This extends the entry_published shortcode by adding a "title" attribute in addition to the ability to added any key/value pair desired that will be rendered as key="value".

@developdaly developdaly Added extended shortcode attributes to entry_published
This extends the entry_published shortcode by adding a "title" attribute in addition to the ability to added any key/value pair desired that will be rendered as key="value".
457bbba
@developdaly

I use this in order to rel="tooltip" to some shortcodes. To complete this pull request it might make sense to add custom shortcode attributes to all shortcodes.

@justintadlock
Owner

I marked this for the 1.6 milestone. 1.5 is about to be released within the next day.

@jayj
jayj commented Jan 9, 2013

It would also be nice to have the option to change the element from <abbr> to <time>. Same for the [comment-published] shortcode.

@developdaly developdaly Updated entry_published shortcode
The shortcode is entirely flexible now. The newly accepted parameters are `class` and `element` adding to the previous parameters of `before`, `after`, `format`, and `title`. 
a8ff298
@justintadlock
Owner

I didn't really get around to this for 1.6. What I'd like to do for the 1.7 release is do a complete overhaul of the shortcodes and see how we can make them better. Rather than just jumping in with this particular enhancement, let's look at all the shortcodes.

@justintadlock justintadlock reopened this May 26, 2013
@jayj
jayj commented May 26, 2013

Will the shortcode_atts_{$shortcode} filter be added in 1.6?

@justintadlock
Owner

Yes, it's already in trunk (line 343 of wp-includes/shortcodes.php).

@jayj
jayj commented May 26, 2013

I mean if the $shortcode argument will be added to shortcodes included in Hybrid Core. Like:

$attr = shortcode_atts( array( 'before' => '', 'after' => '' ), $attr, 'edit_link' );
@justintadlock
Owner

I didn't realize the need for the extra parameter. I'll add that in.

@jayj
jayj commented Jul 9, 2013

The HTML5 validator gives an error on <time> elements:

"The text content of element time was not in the required format: The literal did not satisfy the time-datetime format".

It can be fixed by adding datetime="' . get_the_time( 'c' ) . '" on the <time> elements.

@Rarst
Rarst commented Jul 9, 2013

'c' date format is bugged in WordPress and doesn't work with time zones correctly, use DATE_W3C constant instead.

@justintadlock
Owner

I went with this:

datetime="' . get_the_time( 'Y-m-d\TH:i:sP' ) . '"
@justintadlock
Owner

Just a note that I'll be doing a complete overhaul of the shortcodes in 1.7. So, let's look over all the ways we can make the whole set better and more useful.

@justintadlock
Owner

The shortcodes in this ticket were dropped in the 2.0 branch. This ticket is no longer valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.