WordPress.org

Make WordPress Core

Changes between Initial Version and Version 4 of Ticket #23570


Ignore:
Timestamp:
03/04/13 01:15:16 (14 months ago)
Author:
wonderboymusic
Comment:

attachment:23570.2.diff​ is patch refreshed against trunk and tested compatibility for these 6 scenarios:

  • Post with the link as the content
  • Post with the link as the content, followed by commentary
  • Post with the link as the content AND has link meta value
  • Post with the link as the content AND has link meta value, followed by commentary
  • Post with the link as metadata, content is empty
  • Post with the link as metadata, followed by commentary

If the theme supports structured-post-formats, nothing happens to the content. The themer can use: the_link(), get_the_link(), and get_content_link( $content ) - all return a URL. get_content_link( $content ) only works if the link is in the post's body.

If the post has a post format of link, the compat runs whether the theme supports it or not.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23570

    • Property Cc lancewillett added
    • Property Component changed from General to Post Formats
  • Ticket #23570 – Description

    initial v4  
    1212 
    1313Introduce `get_content_link( &$content, $remove = false )` to find a URL in an arbitrary string meeting the above criteria and optionally remove the found URL if it wasn't embedded in HTML content. 
    14  
    15 = Tested 
    16  
    17 Theme doesn't support 'link' post format, but post has 'link' post format. `the_content()` is called. 
    18 - Not in the post and has meta: only shows once 
    19 - In the post and has meta: nothing changes, only shows once 
    20 - URL in the post and has meta with a different URL: both links show, the meta url is formatted 
    21 - In the post and has no meta: wrapped in an <a> tag with the `post_title` as anchor text, if present, only shows once 
    22 - In the post as an href and has meta: nothing changes, only shows once 
    23 - In the post as an href and has no meta: nothing changes, only shows once 
    24  
    25 Theme doesn't support 'link' post format, but post has 'link' post format, and `the_link()` and `the_content()` are called in succession. 
    26 - Not in the post and has meta: URL is output, content is output with a formatted link. Themer should use if / else. 
    27 - In the post and has meta: URL is output, content is output unchanged. Themer should use if / else. 
    28 - URL in the post and has meta with a different URL: meta URL is output, post URL remains, meta URL is formatted and added to post. Themer should use if / else. 
    29 - In the post and has no meta: URL is output, content is output with a formatted link. Themer should use if / else. 
    30 - In the post as an href and has meta: URL is output, content is unchanged. Themer should use if / else. 
    31 - In the post as an href and has no meta: URL is output, content is unchanged. Themer should use if / else. 
    32  
    33 Theme does support 'link' post format. `the_content()` is called. 
    34 - Not in the post and has meta: Content is unchanged. 
    35 - In the post and has meta: Content is unchanged. 
    36 - URL in the post and has meta with a different URL: Content is unchanged. 
    37 - In the post and has no meta: Content is unchanged. 
    38 - In the post as an href and has meta: Content is unchanged. 
    39 - In the post as an href and has no meta: Content is unchanged.  
    40  
    41 Theme does support 'link' post format. `the_link()` and `the_content()` are called in succession. 
    42 - Not in the post and has meta: URL is output, Content is unchanged. 
    43 - In the post and has meta: URL is output, Content is unchanged. 
    44 - URL in the post and has meta with a different URL: Meta URL is output, Content is unchanged. 
    45 - In the post and has no meta: URL is output, Content is unchanged. 
    46 - In the post as an href and has meta: URL is output, Content is unchanged. 
    47 - In the post as an href and has no meta: URL is output, Content is unchanged.