Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#3916 closed defect (bug) (fixed)

Fix for 'link_rating' filter

Reported by: chriskbchan Owned by: rob1n
Milestone: 2.2 Priority: low
Severity: minor Version: 2.1.2
Component: General Keywords: has-patch commit
Focuses: Cc:


The 'link_rating' filter is not called even 'show_rating' is set in any get links functions. This fix should enable this by calling 'get_linkrating' appropriately.

Attachments (3)

bookmark-template.php.diff (598 bytes) - added by chriskbchan 11 years ago.
bookmark-template-php.diff (758 bytes) - added by jhodgdon 11 years ago.
Patch that adds spaces before the output of ratings
3916.diff (673 bytes) - added by rob1n 11 years ago.
Why not just use $between? That's what it's there for, no?

Download all attachments as: .zip

Change History (17)

#1 @chriskbchan
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#2 @foolswisdom
11 years ago

  • Keywords has-patch added
  • Milestone changed from 2.1.3 to 2.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

#3 @jhodgdon
11 years ago

  • Keywords reporter-feedback added

I tested this patch, and although it adds the rating text, I think maybe it needs a space in there. The default behavior in today's trunk anyway (2.1.2 version, approximately) is that get_linkrating has no filters, so it is just putting out a number, and it gets appended with no spaces onto whatever else is being printed out (such as the description). Add a space to the patch, right before the rating print-out, and things will be nicer...

Just a thought...

11 years ago

Patch that adds spaces before the output of ratings

#4 @jhodgdon
11 years ago

That was tested in SVN revision # 4984

#5 @chriskbchan
11 years ago

Originally I did put the space before the ratings, however, I think it's what to be done by the plugin, as you could check out my blog http://blog.chris-chan.com/, I have the plugin showing an image rather text, without the space it actually looks nicer! Please comment.

#6 @jhodgdon
11 years ago

Without the space, the default behavior (putting the number in) looks very bad. Though I agree not many people are likely to use the un-filtered default behavior.

I don't see any link ratings on your site...

#7 @chriskbchan
11 years ago

You should find the link ratings under the 'Recently Watched Movies' on the sidebar. I have written a very simple plugin to represent the rating with 'stars' according to the rating I have given to a particular movie (that's how I find this patch necessary since without this modification my plugin will not work). As the 'stars' images I have been using have some white spaces before them, with an extra space the 'stars' will be further apart from the link. As we can't assume what will be displayed by the plugin, either Text or Image, I guess the best place to do the spacing will be from the plugin. Just my 20cents.

#8 @chriskbchan
11 years ago

One more thing, if you check the original source, those codes for appending contents for 'show_updated' & 'show_description' didn't assume space before them also. So I think it's better to discard the space.

#9 @jhodgdon
11 years ago

Not quite true. show_description has an extra flag "between" to say what to put between the image and description.

But point taken.

#10 @jhodgdon
11 years ago

  • Keywords tested added; reporter-feedback removed

Recommend taking first patch above (without spaces).

#11 @rob1n
11 years ago

  • Keywords tested link rating filter removed

I'm +1 for the first patch. Currently we don't even respect $show_rating, so that's a big bug right there.

11 years ago

Why not just use $between? That's what it's there for, no?

#12 @rob1n
11 years ago

  • Owner changed from chriskbchan to rob1n
  • Status changed from reopened to new

#13 @rob1n
11 years ago

  • Keywords commit added

#14 @rob1n
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5153]) Add link rating to wp_list_bookmarks(). fixes #3916

Note: See TracTickets for help on using tickets.