Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#27234 closed enhancement (fixed)

Adding filters for WP_Admin_Bar::add_node() method

Reported by: arpittambiin's profile arpit.tambi.in Owned by: stephcook22's profile stephcook22
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.3
Component: Toolbar Keywords: good-first-bug has-patch commit
Focuses: Cc:

Description

I needed to add a rel="nofollow" attribute to one of the links on toolbar but couldn't as there is no filter to let me change default toolbar behavior.

I ended up modifying source code at line 435 https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-includes/class-wp-admin-bar.php#L435

Attachments (2)

27234.diff (1.2 KB) - added by stephcook22 11 years ago.
Added rel meta to WP_Admin_Bar::add_node()
27234-2.diff (1.2 KB) - added by stephcook22 11 years ago.
Revised for SergeyBiryukov's comments. Apologies.

Download all attachments as: .zip

Change History (10)

#1 @danielbachhuber
11 years ago

  • Focuses template removed
  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 3.8.1 to 3.3

Seems like a reasonable request. I'd recommend making it a new supported value for the meta argument when adding a node.

#2 @SergeyBiryukov
11 years ago

  • Summary changed from Adding filters for Wordpress Toolbar add_node method to Adding filters for WP_Admin_Bar::add_node() method

@stephcook22
11 years ago

Added rel meta to WP_Admin_Bar::add_node()

#3 @stephcook22
11 years ago

  • Keywords has-patch added; needs-patch removed

#4 @DrewAPicture
11 years ago

  • Owner set to stephcook22
  • Status changed from new to assigned

#5 @SergeyBiryukov
11 years ago

Please use tabs rather than spaces for indentation (per WordPress Coding Standards).

@stephcook22
11 years ago

Revised for SergeyBiryukov's comments. Apologies.

#6 @DrewAPicture
11 years ago

  • Keywords commit added
  • Milestone changed from Future Release to 3.9

27234-2.diff appears to be in order.

#7 @nacin
11 years ago

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

In 27367:

Accept rel attributes in the toolbar's add_node() method.

props stephcook22.
fixes #27234.

#8 @AlphaGolf_fr
11 years ago

#26990 was marked as a duplicate.

Note: See TracTickets for help on using tickets.