Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5792

WP 5.6: add_theme_support( 'post-formats' ) was called incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Released
    • Icon: Should have Should have
    • 2.52.0
    • None
    • 3
    • Admin Panel
    • Sprint #152

      WP5.6 throws a new notice

      Notice:  add_theme_support( 'post-formats' ) was called incorrectly. You need to pass an array of post formats.
      

      Called in master-theme/src/MasterSite.php l.100 : add_theme_support( 'post-formats' ).

      Change: https://github.com/WordPress/WordPress/commit/3fc623c202a563b55676455733af9a6232443081#diff-36f6a0c5c011a86d9107d51e8deafdc83f94014adcb5d696b6a5f7c8c2e12293R2529

      This change means that a call to the function current_theme_supports( 'post-formats' ) will now return false instead of true.

      The rest of the dependent code, like post_type_supports() shouldn't change, as we were not specifying any post-format before.

      We don't seem to be using this functionality (see desc. https://wordpress.org/support/article/post-formats/.) The only occurrence I see is in a plugin of GP Nordic https://github.com/greenpeace/planet4-gpnordic-plugin-portrait/blob/0934e436ace46a1ef8fe2bb4cda92bf2efd155f2/includes/acf/includes/locations/class-acf-location-post-format.php#L100 but this shouldn't be impacted.
      Our support for this was introduced a long time ago https://github.com/greenpeace/planet4-master-theme/commit/f4c796d99255f5d6ced5aaaf4c67f97196c020cd#diff-01c9525afc2c87cfcb03124117c9d0ebb067029f6c955a607fa0fd4274aca556R13 from a starter theme it seems https://github.com/timber/starter-theme/commit/f4c796d99255f5d6ced5aaaf4c67f97196c020cd

       It looks like we could remove this call without any side-effect.

            sdeshmuk Sagar Deshmukh
            fhernand Florent Hernandez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: