Commit Graph

352 Commits

Author SHA1 Message Date
Andrew Nacin 694a03be6a Drop get_images_in_content() and get_image_in_content(), until recently get_content_image(s)(). fixes #24202.
git-svn-id: https://develop.svn.wordpress.org/trunk@24685 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-12 20:34:07 +00:00
Andrew Nacin 09658b5a03 Add types parameter to get_media_embedded_in_content(). props aaroncampbell. see #24202.
git-svn-id: https://develop.svn.wordpress.org/trunk@24684 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-12 19:51:59 +00:00
Andrew Nacin a187c535ca Simplify and reduce the new media/content extraction functions.
The URL extraction function is now get_url_in_content(). For more, see #24202.

Also adds filters to get_post_galleries() and get_post_gallery(). fixes #24309.



git-svn-id: https://develop.svn.wordpress.org/trunk@24682 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-12 19:34:59 +00:00
Andrew Nacin cdaa82bc9b Use wp_basename() in newer media code for filenames to avoid encoding issues on display. props SergeyBiryukov, fixes #23267.
git-svn-id: https://develop.svn.wordpress.org/trunk@24585 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-08 13:55:50 +00:00
Mark Jaquith e47e61424f Make sure `get_post_gallery()` doesn't ever return an array when asked for a string.
props kovshenin, wonderboymusic, ocean90. fixes #24270.

git-svn-id: https://develop.svn.wordpress.org/trunk@24572 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-05 20:54:46 +00:00
Mark Jaquith 70eedabc2b Drop some wrapper functions
* `get_attached_audio()` (use `get_attached_media( 'audio' )`)
* `get_attached_images()` (use `get_attached_media( 'image' )`)
* `get_attached_videos()` (use `get_attached_media( 'video' )`)

props wonderboymusic. fixes #23843.

git-svn-id: https://develop.svn.wordpress.org/trunk@24571 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-05 20:41:49 +00:00
Dominik Schilling (ocean90) 38e7f8d441 Remove the_post_format_gallery(). see #24452.
git-svn-id: https://develop.svn.wordpress.org/trunk@24570 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-05 20:37:12 +00:00
Dominik Schilling (ocean90) f89a4f5b21 Remove img_html_to_post_id(). It's unused since [24555]. fixes #24610.
git-svn-id: https://develop.svn.wordpress.org/trunk@24569 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-05 18:45:41 +00:00
Mark Jaquith 00e2ca3b6f Remove some more post format functions.
props wonderboymusic. fixes #24610.

git-svn-id: https://develop.svn.wordpress.org/trunk@24555 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-04 06:57:00 +00:00
Dominik Schilling (ocean90) cf6a29cfa1 Lose content removal and splitting from get_content_url(). And remove unneeded lines from [24400].
fixes #24484.

git-svn-id: https://develop.svn.wordpress.org/trunk@24554 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-03 22:36:13 +00:00
Andrew Nacin bc4b7fd0a5 Allow gallery to be inserted with no links on the images. props chipbennett, helgatheviking, aaroncampbell, wonderboymusic. fixes #18178.
git-svn-id: https://develop.svn.wordpress.org/trunk@24550 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-03 20:43:19 +00:00
Andrew Nacin 9bac10425e Remove attachment_url_to_postid(). props kovshenin, wonderboymusic. see #24458.
git-svn-id: https://develop.svn.wordpress.org/trunk@24548 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-03 20:23:48 +00:00
Andrew Nacin 58b96f9dd5 Call shortcode functions directly. props kovshenin, fixes #24505.
git-svn-id: https://develop.svn.wordpress.org/trunk@24547 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-03 20:19:00 +00:00
Mark Jaquith cf3f5acf71 Lose content removal and splitting from the media extraction functions.
see #24484

git-svn-id: https://develop.svn.wordpress.org/trunk@24400 602fd350-edb4-49c9-b593-d223f7449a82
2013-06-03 19:27:58 +00:00
Andrew Nacin 51731fc3eb No need for a pass-by-reference here. props sunnyratilal, fixes #24433.
git-svn-id: https://develop.svn.wordpress.org/trunk@24376 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-27 15:47:46 +00:00
Sergey Biryukov e4e71d98ba Add @return for get_the_post_format_image(). Make sure the function always returns a string. props tollmanz. fixes #24414. see #24348.
git-svn-id: https://develop.svn.wordpress.org/trunk@24352 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-24 23:56:00 +00:00
Jon Cave cc6a2a0a0e Properly escape source parameter in audio/video shortcodes. See #23282.
git-svn-id: https://develop.svn.wordpress.org/trunk@24334 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-23 17:45:59 +00:00
Sergey Biryukov 2bb8434469 Switch to a CSS comment in gallery_shortcode() to avoid breaking markup when the shortcode is used inside an HTML comment. props mark-k, aaroncampbell. fixes #23787.
git-svn-id: https://develop.svn.wordpress.org/trunk@24329 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-22 22:27:53 +00:00
Ryan Boren de589f8ebe Remove redundant post ID validation.
Props SergeyBiryukov
fixes #24199


git-svn-id: https://develop.svn.wordpress.org/trunk@24249 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-14 13:57:59 +00:00
Mark Jaquith 5cd3b7c3ab Improve regular expressions by using a backreference to match right quote of quote pair when matching attributes.
props kovshenin. see #24225.

git-svn-id: https://develop.svn.wordpress.org/trunk@24241 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-10 22:54:33 +00:00
Mark Jaquith a8fe299c1c Return the requested image size in get_the_post_format_image()
props kovshenin. fixes #24188.

git-svn-id: https://develop.svn.wordpress.org/trunk@24240 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-10 22:49:24 +00:00
Ryan Boren edee280e39 Avoid warning in gallery_shortcode() when called outside of post context.
Props kovshenin
fixes #24272


git-svn-id: https://develop.svn.wordpress.org/trunk@24198 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-08 16:57:58 +00:00
Andrew Nacin 12e7328690 Variables passed by reference do not need to be set first.
props kovshenin.
see #24222.



git-svn-id: https://develop.svn.wordpress.org/trunk@24129 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-29 14:48:31 +00:00
Sergey Biryukov 7ab8ec298f Remove extraneous function parameters in wp_video_shortcode(). props rlerdorf. see #24210.
git-svn-id: https://develop.svn.wordpress.org/trunk@24122 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-29 00:56:27 +00:00
Sergey Biryukov 57b9f9ecab Fix typo in get_the_post_format_image(). props rlerdorf. see #23964. see #24210.
git-svn-id: https://develop.svn.wordpress.org/trunk@24118 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-28 06:36:39 +00:00
Mark Jaquith 116b530bb3 the_post_format_gallery() (and Twenty Thirteen using it).
fixes #24126. props obenland, wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@24093 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 07:42:59 +00:00
Mark Jaquith 63a5118e7e Smarter structured post format caching.
fixes #24002. props kovshenin, wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@24091 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 07:10:35 +00:00
Mark Jaquith 31cf12d5e1 Fix issue with [embed] in post_format_compat.
props kovshenin. fixes #24070.

git-svn-id: https://develop.svn.wordpress.org/trunk@24083 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 03:52:05 +00:00
Mark Jaquith 53de215895 Allow the_post_format_image() to choose an image size late in the game.
props davidwilliamson, SergeyBiryukov. fixes #23945.

git-svn-id: https://develop.svn.wordpress.org/trunk@24079 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 02:28:30 +00:00
Mark Jaquith 25a32a446c Fix mangled image output in compat function.
props wonderboymusic. see #24175.

git-svn-id: https://develop.svn.wordpress.org/trunk@24078 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-25 02:18:49 +00:00
Mark Jaquith 065010983e Multiple improvements to image post format insertion and display.
* get_tag_regex() altered based on Unit Tests.
* Changes to post-formats.js to provide size and link context during image selection.
* Captions are now output in the_post_format_image() when present.
* The meta value for url is respected for the image post format when the HTML in the image meta doesn't include a link

props wonderboymusic. fixes #23965, #23964. see #24147, #24046.

git-svn-id: https://develop.svn.wordpress.org/trunk@24066 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-22 22:11:42 +00:00
Mark Jaquith 177556309d Standardize post format postmeta keys around the ones already used by the Crowd Favorite plugin.
props wonderboymusic. fixes #24010.

git-svn-id: https://develop.svn.wordpress.org/trunk@24021 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 20:57:44 +00:00
Mark Jaquith 793f27f07e New Post Format UI chooser treatment in response to testing.
* Bigger icons
* Format description under each
* UI hides after choice
* Saving without choosing implies "Standard"
* Helpful text, with "Change format" link

see #24046. props lessbloat, wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@24006 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-17 04:08:46 +00:00
Mark Jaquith e1c6e9f2da Make get_the_post_format_image() work when intermediate_image_sizes is empty.
props lancewillett. fixes #24060.

git-svn-id: https://develop.svn.wordpress.org/trunk@24003 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-16 21:31:37 +00:00
Sergey Biryukov a2b9d958df * Add start/end markers to the regex patterns in audio and video embed handlers.
* Move the handler functions registration to wp_maybe_load_embeds().
* Rename both functions to match the wp_embed_handler_* pattern.
* Move the functions closer to wp_embed_handler_googlevideo().

props kovshenin. fixes #24092.

git-svn-id: https://develop.svn.wordpress.org/trunk@24000 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-16 11:06:31 +00:00
Mark Jaquith 95c3de8a9f Link post format images if a URL is provided. Make the URL available via get_the_post_format_url().
props wonderboymusic, obenland. fixes #23964.

git-svn-id: https://develop.svn.wordpress.org/trunk@23992 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-14 16:59:52 +00:00
Mark Jaquith d87dd076d4 Constrain large videos from rendering bigger than $content_width on both frontend and backend.
props wonderboymusic. fixes #23955.

git-svn-id: https://develop.svn.wordpress.org/trunk@23989 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-14 16:43:26 +00:00
Dominik Schilling (ocean90) c907f0f4a7 Don't print links for unsupported file types in wp_video_shortcode()/wp_audio_shortcode(). Return them instead.
props SergeyBiryukov. fixes #24075.

git-svn-id: https://develop.svn.wordpress.org/trunk@23988 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-14 10:33:44 +00:00
Mark Jaquith 74319333ed Only remove ONE piece of media from the content in setup_postdata().
props wonderboymusic. fixes #24052.

git-svn-id: https://develop.svn.wordpress.org/trunk@23984 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-14 01:11:44 +00:00
Mark Jaquith 79c4e52ffa Enforce video dimensions.
props wonderboymusic. see #23831.

git-svn-id: https://develop.svn.wordpress.org/trunk@23969 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-11 22:34:05 +00:00
Sergey Biryukov c579fc339b Use the function argument instead of the $post global in get_the_post_format_image(). props kovshenin. fixes #24003.
git-svn-id: https://develop.svn.wordpress.org/trunk@23938 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-09 16:28:09 +00:00
Sergey Biryukov c436d61d37 Consistently use the function argument instead of the $post global in get_the_post_format_media(). props kovshenin. fixes #24003.
git-svn-id: https://develop.svn.wordpress.org/trunk@23937 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-09 13:42:53 +00:00
Andrew Nacin 62e7bbe52a Third parameter for shortcode_atts() for audio and video shortcodes. props obenland, see #23282.
git-svn-id: https://develop.svn.wordpress.org/trunk@23921 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-05 17:46:31 +00:00
Mark Jaquith 2ab2451508 Standardize the post format theme API functions with the_post_format_THING() and get_the_post_format_THING().
fixes #23927

git-svn-id: https://develop.svn.wordpress.org/trunk@23899 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-04 08:09:02 +00:00
Mark Jaquith a2855f94b3 Sanity checks on image metadata to avoid warnings, etc.
fixes #23733. props wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@23873 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 20:51:35 +00:00
Sergey Biryukov 43e15b47d4 Make a copy of post content to avoid changing it in get_the_image(). Remove unnecessary assignment from get_the_media(). props wonderboymusic for initial patch. fixes #23888.
git-svn-id: https://develop.svn.wordpress.org/trunk@23869 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 19:10:31 +00:00
Mark Jaquith fe4da10a48 Add compat code for 'image' post format.
see #19570. props wonderboymusic.

git-svn-id: https://develop.svn.wordpress.org/trunk@23847 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 05:21:23 +00:00
Mark Jaquith e7cde8715f Post Format UI.
* Icons
* Selection
* Prompt text
* Special fields
* Styling
* Sparkles

This is going to need testing, polish, and love.

see #19570. props melchoyce, helen, wonderboymusic, lessbloat, rachelbaker, aaroncampbell, DrewAPicture, ryelle.

git-svn-id: https://develop.svn.wordpress.org/trunk@23843 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 03:35:41 +00:00
Mark Jaquith e187d14142 Move the "look for the first media attachment" code below the "look
in the post content for media" code, so that it is the method of last
resort. This way, if you attach AND embed media, you won't get duplication.

fixes #23879

git-svn-id: https://develop.svn.wordpress.org/trunk@23840 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-28 07:28:27 +00:00
Mark Jaquith 3817df14ec Add some filters to the image extraction-from-post bits so people with
existing postmeta-based flows can hook in and make magic happen.

props wonderboymusic. fixes #22960.

git-svn-id: https://develop.svn.wordpress.org/trunk@23821 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-27 19:07:58 +00:00