Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Icons Widget: Add more common feed url components to supported icons #13183

Commits on Aug 5, 2019

  1. Added more common feed url components to get_supported_icons()

    As an improvement based on the issue Automattic#10662 "Social Icons Widget: allow for alternate feed URLs" this adds some more common feed url components to the get_supported_icons() function. The existing version only matches the existence of "/feed/" in the url being added, as such many other feed URL formats would end up showing with the default link icon instead. Whilst it may still not catch all possilbe feed url formats it will catch many commonly used formats as well as non-permalink versions of WordPress feeds.
    rickcurran committed Aug 5, 2019
    Configuration menu
    Copy the full SHA
    a959b41 View commit details
    Browse the repository at this point in the history
  2. Corrected spaces to tabs, clarified some of the RSS feed sources

    Fixed incorrect use of spaces instead of tabs.
    Added some additional comments regarding which sources RSS feeds may come from.
    rickcurran committed Aug 5, 2019
    Configuration menu
    Copy the full SHA
    c445ccb View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2019

  1. Moved Feed formats into $feed_url_formats array

    There are many possible RSS Feed url formats that can be used to match for the RSS Feed icon, so to reduce repetition of multiple 'feed' entries in the `$social_links_icons` array a separate `$feed_url_formats` now contains the common 'feed' icon and the various feed url parameters. As such it means the 'url' of an item in the `$social_links_icons` array can itself be an array so the code for rendering the widget has been updated to accommodate this.
    rickcurran committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    9a6bb55 View commit details
    Browse the repository at this point in the history
  2. Simplified the code by setting all $social_links_icons urls as arrays

    The previous commit added the various `$social_links_icons` 'feed' items as an array. This cleaned up the code but also added a bit of repetition due to having to check whether a `$social_links_icons` url element was an array and subsequently handle them in two different ways but duplicating some code in the process.
    
    This update changes all url elements in the `$social_links_icons` array to be an array even if there is only one item (as most of them do). This means that the code used to check if a url matches only needs to presume the url element comes as an array. This also enables the possibilty that some of the existing items e.g. Amazon can be reduced to one entry in the `$social_links_icons` array.
    rickcurran committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    1be5dcb View commit details
    Browse the repository at this point in the history
  3. Reduced multiple entries for Amazon & others urls in `$social_links_i…

    …cons` array
    
    This commit reduces the separate entries that exist for Amazon, Google, Discord and WordPress domains into single items with multiple url array items instead.
    rickcurran committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    3617123 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2019

  1. Widgets: merge Feed array with rest of supported icons

    Now that all supported services use the array format, we can move this whole array back in without creating any confusion.
    jeherve committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    2885b8a View commit details
    Browse the repository at this point in the history
  2. Simplify the display of each icon

    - Since we know for sure $social_icon['url'] is going to be an array, let's remove the extra check
    - Use printf instead of 2 echo
    - Add phpcs:ignore to avoid error on output
    jeherve committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    517f657 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e9d16a8 View commit details
    Browse the repository at this point in the history