Congratulations!

[Valid RSS] This is a valid RSS feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://core.trac.wordpress.org/ticket/37972?format=rss

  1. <?xml version="1.0"?>
  2. <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  3.  <channel>
  4.    <title>WordPress Trac: Ticket #37972: Image size (height/width) arguments are not used in output for custom_logo</title>
  5.    <link>https://core.trac.wordpress.org/ticket/37972</link>
  6.    <description>&lt;p&gt;
  7. when setting up the custom logo in theme support, it allows for height/width to be set.
  8. &lt;/p&gt;
  9. &lt;p&gt;
  10. When outputting, the default and only option for the output (via the_custom_logo() ) is "full" (as set in the get_custom_logo function call)
  11. &lt;/p&gt;
  12. &lt;p&gt;
  13. This is carry over from commit
  14. &lt;a class="changeset" href="https://core.trac.wordpress.org/changeset/37135" title="Template: Remove `$size` reference from `get_custom_logo()`.
  15. Argument ..."&gt;[37135]&lt;/a&gt; for &lt;a class="closed ticket" href="https://core.trac.wordpress.org/ticket/36327" title="#36327: defect (bug): Custom logo: the image size argument is not taking in account (closed: fixed)"&gt;#36327&lt;/a&gt;
  16. &lt;/p&gt;
  17. </description>
  18.    <language>en-us</language>
  19.    <image>
  20.      <title>WordPress Trac</title>
  21.      <url>https://core.trac.wordpress.org/chrome/site/your_project_logo.png</url>
  22.      <link>https://core.trac.wordpress.org/ticket/37972</link>
  23.    </image>
  24.    <generator>Trac 1.2.2</generator>
  25.    <item>
  26.      
  27.        <dc:creator>slackbot</dc:creator>
  28.  
  29.      <pubDate>Tue, 15 May 2018 17:19:08 GMT</pubDate>
  30.      <title></title>
  31.      <link>https://core.trac.wordpress.org/ticket/37972#comment:1</link>
  32.      <guid isPermaLink="false">https://core.trac.wordpress.org/ticket/37972#comment:1</guid>
  33.      <description>
  34.        &lt;p&gt;
  35. &lt;em&gt;This ticket was mentioned in &lt;a class="ext-link" href="https://make.wordpress.org/chat/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Slack&lt;/a&gt; in #themereview by joyously. &lt;a class="ext-link" href="https://wordpress.slack.com/archives/themereview/p1526404747000759"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;View the logs&lt;/a&gt;.&lt;/em&gt;
  36. &lt;/p&gt;
  37.      </description>
  38.      <category>Ticket</category>
  39.    </item><item>
  40.      
  41.        <dc:creator>prbot</dc:creator>
  42.  
  43.      <pubDate>Thu, 24 Jun 2021 00:48:19 GMT</pubDate>
  44.      <title>keywords set</title>
  45.      <link>https://core.trac.wordpress.org/ticket/37972#comment:2</link>
  46.      <guid isPermaLink="false">https://core.trac.wordpress.org/ticket/37972#comment:2</guid>
  47.      <description>
  48.          &lt;ul&gt;
  49.            &lt;li&gt;&lt;strong&gt;keywords&lt;/strong&gt;
  50.              &lt;em&gt;has-patch&lt;/em&gt; added
  51.            &lt;/li&gt;
  52.          &lt;/ul&gt;
  53.        &lt;p&gt;
  54. &lt;em&gt;This ticket was mentioned in &lt;a class="ext-link" href="https://github.com/WordPress/wordpress-develop/pull/1423"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;PR #1423&lt;/a&gt; on &lt;a class="ext-link" href="https://github.com/WordPress/wordpress-develop/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;WordPress/wordpress-develop&lt;/a&gt; by &lt;a class="ext-link" href="https://github.com/paulschreiber"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;paulschreiber&lt;/a&gt;.&lt;/em&gt;
  55. Fetch the height and width from the custom logo settings. If present, pass them in as a size parameter to wp_get_attachment_image().
  56. &lt;/p&gt;
  57. &lt;p&gt;
  58. Trac ticket: &lt;a href="https://core.trac.wordpress.org/ticket/37972"&gt;https://core.trac.wordpress.org/ticket/37972&lt;/a&gt;
  59. &lt;/p&gt;
  60.      </description>
  61.      <category>Ticket</category>
  62.    </item><item>
  63.      
  64.        <dc:creator>prbot</dc:creator>
  65.  
  66.      <pubDate>Fri, 08 Nov 2024 02:00:28 GMT</pubDate>
  67.      <title></title>
  68.      <link>https://core.trac.wordpress.org/ticket/37972#comment:3</link>
  69.      <guid isPermaLink="false">https://core.trac.wordpress.org/ticket/37972#comment:3</guid>
  70.      <description>
  71.        &lt;p&gt;
  72. &lt;a class="ext-link" href="https://profiles.wordpress.org/hemak/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;@hemak&lt;/a&gt; commented on &lt;a class="ext-link" href="https://github.com/WordPress/wordpress-develop/pull/1423#issuecomment-2463606398"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;PR #1423&lt;/a&gt;:
  73. &lt;/p&gt;
  74. &lt;p&gt;
  75. To fetch the height and width from the custom logo settings in WordPress and pass them as a size parameter to &lt;code&gt;wp_get_attachment_image()&lt;/code&gt;, you can use the following approach:
  76. &lt;/p&gt;
  77. &lt;ol&gt;&lt;li&gt;&lt;strong&gt;Get the Custom Logo ID&lt;/strong&gt;: Use &lt;code&gt;get_theme_mod( 'custom_logo' )&lt;/code&gt; to retrieve the custom logo ID.
  78. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Get the Image Metadata&lt;/strong&gt;: Use &lt;code&gt;wp_get_attachment_metadata()&lt;/code&gt; to fetch the logo’s width and height.
  79. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Pass Dimensions to &lt;code&gt;wp_get_attachment_image()&lt;/code&gt;&lt;/strong&gt;: Once you have the dimensions, pass them in the &lt;code&gt;size&lt;/code&gt; parameter when calling &lt;code&gt;wp_get_attachment_image()&lt;/code&gt;.
  80. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
  81. Here’s an example code snippet:
  82. &lt;/p&gt;
  83. &lt;div class="wiki-code"&gt;&lt;div class="code"&gt;&lt;pre&gt;&lt;span class="x"&gt;// Get the custom logo ID
  84. $custom_logo_id = get_theme_mod( 'custom_logo' );
  85. // Check if a custom logo is set
  86. if ( $custom_logo_id ) {
  87.    // Get the logo metadata
  88.    $logo_metadata = wp_get_attachment_metadata( $custom_logo_id );
  89.    // Extract width and height if available
  90.    $width = $logo_metadata['width'] ?? '';
  91.    $height = $logo_metadata['height'] ?? '';
  92.    // Pass width and height to wp_get_attachment_image as an array
  93.    echo wp_get_attachment_image( $custom_logo_id, [ $width, $height ] );
  94. }
  95. &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;
  96. &amp;lt;sub&amp;gt;&amp;lt;sup style="font-size: 0.1em;"&amp;gt;&lt;a class="ext-link" href="https://example.com"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;.&lt;/a&gt;&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;
  97. &lt;/p&gt;
  98. &lt;p&gt;
  99. This code checks if a custom logo exists, retrieves its dimensions, and then passes those dimensions as an array to &lt;code&gt;wp_get_attachment_image()&lt;/code&gt;. This approach ensures the custom logo appears at its correct size.
  100. &lt;/p&gt;
  101.      </description>
  102.      <category>Ticket</category>
  103.    </item>
  104. </channel>
  105. </rss>

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid RSS" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//core.trac.wordpress.org/ticket/37972%3Fformat%3Drss

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda