This is a valid RSS feed.
This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
</description>
<title>WordPress Trac</title>
^
line 30, column 13: (2 occurrences) [help]
<title></title>
^
</channel>
^
<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<title>WordPress Trac: Ticket #37972: Image size (height/width) arguments are not used in output for custom_logo</title>
<link>https://core.trac.wordpress.org/ticket/37972</link>
<description><p>
when setting up the custom logo in theme support, it allows for height/width to be set.
</p>
<p>
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)
</p>
<p>
This is carry over from commit
<a class="changeset" href="https://core.trac.wordpress.org/changeset/37135" title="Template: Remove `$size` reference from `get_custom_logo()`.
Argument ...">[37135]</a> for <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)">#36327</a>
</p>
</description>
<language>en-us</language>
<image>
<title>WordPress Trac</title>
<url>https://core.trac.wordpress.org/chrome/site/your_project_logo.png</url>
<link>https://core.trac.wordpress.org/ticket/37972</link>
</image>
<generator>Trac 1.2.2</generator>
<item>
<dc:creator>slackbot</dc:creator>
<pubDate>Tue, 15 May 2018 17:19:08 GMT</pubDate>
<title></title>
<link>https://core.trac.wordpress.org/ticket/37972#comment:1</link>
<guid isPermaLink="false">https://core.trac.wordpress.org/ticket/37972#comment:1</guid>
<description>
<p>
<em>This ticket was mentioned in <a class="ext-link" href="https://make.wordpress.org/chat/"><span class="icon"></span>Slack</a> in #themereview by joyously. <a class="ext-link" href="https://wordpress.slack.com/archives/themereview/p1526404747000759"><span class="icon"></span>View the logs</a>.</em>
</p>
</description>
<category>Ticket</category>
</item><item>
<dc:creator>prbot</dc:creator>
<pubDate>Thu, 24 Jun 2021 00:48:19 GMT</pubDate>
<title>keywords set</title>
<link>https://core.trac.wordpress.org/ticket/37972#comment:2</link>
<guid isPermaLink="false">https://core.trac.wordpress.org/ticket/37972#comment:2</guid>
<description>
<ul>
<li><strong>keywords</strong>
<em>has-patch</em> added
</li>
</ul>
<p>
<em>This ticket was mentioned in <a class="ext-link" href="https://github.com/WordPress/wordpress-develop/pull/1423"><span class="icon"></span>PR #1423</a> on <a class="ext-link" href="https://github.com/WordPress/wordpress-develop/"><span class="icon"></span>WordPress/wordpress-develop</a> by <a class="ext-link" href="https://github.com/paulschreiber"><span class="icon"></span>paulschreiber</a>.</em>
Fetch the height and width from the custom logo settings. If present, pass them in as a size parameter to wp_get_attachment_image().
</p>
<p>
Trac ticket: <a href="https://core.trac.wordpress.org/ticket/37972">https://core.trac.wordpress.org/ticket/37972</a>
</p>
</description>
<category>Ticket</category>
</item><item>
<dc:creator>prbot</dc:creator>
<pubDate>Fri, 08 Nov 2024 02:00:28 GMT</pubDate>
<title></title>
<link>https://core.trac.wordpress.org/ticket/37972#comment:3</link>
<guid isPermaLink="false">https://core.trac.wordpress.org/ticket/37972#comment:3</guid>
<description>
<p>
<a class="ext-link" href="https://profiles.wordpress.org/hemak/"><span class="icon"></span>@hemak</a> commented on <a class="ext-link" href="https://github.com/WordPress/wordpress-develop/pull/1423#issuecomment-2463606398"><span class="icon"></span>PR #1423</a>:
</p>
<p>
To fetch the height and width from the custom logo settings in WordPress and pass them as a size parameter to <code>wp_get_attachment_image()</code>, you can use the following approach:
</p>
<ol><li><strong>Get the Custom Logo ID</strong>: Use <code>get_theme_mod( 'custom_logo' )</code> to retrieve the custom logo ID.
</li><li><strong>Get the Image Metadata</strong>: Use <code>wp_get_attachment_metadata()</code> to fetch the logo’s width and height.
</li><li><strong>Pass Dimensions to <code>wp_get_attachment_image()</code></strong>: Once you have the dimensions, pass them in the <code>size</code> parameter when calling <code>wp_get_attachment_image()</code>.
</li></ol><p>
Here’s an example code snippet:
</p>
<div class="wiki-code"><div class="code"><pre><span class="x">// Get the custom logo ID
$custom_logo_id = get_theme_mod( 'custom_logo' );
// Check if a custom logo is set
if ( $custom_logo_id ) {
// Get the logo metadata
$logo_metadata = wp_get_attachment_metadata( $custom_logo_id );
// Extract width and height if available
$width = $logo_metadata['width'] ?? '';
$height = $logo_metadata['height'] ?? '';
// Pass width and height to wp_get_attachment_image as an array
echo wp_get_attachment_image( $custom_logo_id, [ $width, $height ] );
}
</span></pre></div></div><p>
&lt;sub&gt;&lt;sup style="font-size: 0.1em;"&gt;<a class="ext-link" href="https://example.com"><span class="icon"></span>.</a>&lt;/sup&gt;&lt;/sub&gt;
</p>
<p>
This code checks if a custom logo exists, retrieves its dimensions, and then passes those dimensions as an array to <code>wp_get_attachment_image()</code>. This approach ensures the custom logo appears at its correct size.
</p>
</description>
<category>Ticket</category>
</item>
</channel>
</rss>
If you would like to create a banner that links to this page (i.e. this validation result), do the following:
Download the "valid RSS" banner.
Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)
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: