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

Avatar overlaps text in Dashboard widget #396

Closed
janboddez opened this issue Jun 2, 2023 · 5 comments
Closed

Avatar overlaps text in Dashboard widget #396

janboddez opened this issue Jun 2, 2023 · 5 comments

Comments

@janboddez
Copy link
Contributor

There's a <div class="dashboard-comment-wrap has-row-actions"> in there, which would need a has-avatar class ...

Not sure if I'm the only one seeing this?

The second mention looks okay because as far as WordPress is concerned, it's just a comment (its comment type is empty).

@janboddez
Copy link
Contributor Author

The issue is in WordPress core. For comments with a type that is non-empty and not comment, has-avatar is simply not added, even if there happens to be one: https://github.com/WordPress/WordPress/blob/f6ee7d285f8cd9568adcebd27a3ae24ae26c7c73/wp-admin/includes/dashboard.php#L887

There doesn't seem to be a way to filter the HTML output, so the only way to fix this would be (1) custom CSS, or (2) create a WP core issue. I don't think very many plugins use comment_type at all, so they may simply not be aware.

@janboddez
Copy link
Contributor Author

janboddez commented Jun 8, 2023

In this particular case, adding something like the following does the trick:

.bookmark .dashboard-comment-wrap {
	padding-inline-start: 63px;
}

Could probably expand that to likes, favorites, reads, and reposts (and any other comment types that aren't comment/empty).

Update: For those who happen to be interested, I have totally added the following to a mu-plugin:

<?php

add_action( 'admin_head', function() {
	?>
	<style rel="stylesheet" type="text/css" media="all">
	.bookmark .dashboard-comment-wrap,
	.favorite .dashboard-comment-wrap
	.like .dashboard-comment-wrap,
	.repost .dashboard-comment-wrap    {
		padding-inline-start: 63px;
	}

	.bookmark .dashboard-comment-wrap .comment-author,
	.favorite .dashboard-comment-wrap .comment-author,
	.like .dashboard-comment-wrap .comment-author,
	.repost .dashboard-comment-wrap .comment-author {
		margin-block-start: 0;
	}
	</style>
	<?php
}, 99 );

Will add the other comment types as I encounter them ...

@bixfrankonis
Copy link

Ah, hell, thanks for that.

@pfefferle
Copy link
Owner

would you like to make a PR for that @janboddez ?

@janboddez
Copy link
Contributor Author

janboddez commented Jan 5, 2024

If this is still an issue, yes.

Ideally, this would be addressed in core; I simply think no one really uses comment types. Except for pingback and so on, but those never have an avatar.

Meanwhile, it's fairy easy to work around. Ideally, we'd load this as a seperate stylesheet (which I think is still the preferred way, for now) and only on the Dashboard page.

I'll have look this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants