WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#14667 closed feature request (wontfix)

Avoid name conflicts for 'make_clickable' when integrating WP with other apps

Reported by: RegisJesuit Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: General Keywords:
Focuses: Cc:
PR Number:

Description

The function 'make_clickable' in wp-includes/formatting.php should be a pluggable function. When programming authentication plugins for other platforms (example: phpBB), 'make_clickable' is a common name between both and the names clash, causing a PHP error. Making it a pluggable function would eliminate this problem completely.

In addition, it would be easier for plugin developers to redefine their own clickables.

Change History (6)

#1 @westi
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Pluggable functions are only really for authentication/authorisation functionality which this is not.

Also in general it is likely that they will become filter/hook based in future rather than replaced by new functions as that is more the WordPress way and also allows for more than one authentication plugin to hook in.

We would not make 'make_clickable' a pluggable function.

#2 @Denis-de-Bernardy
9 years ago

  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Summary changed from Make function 'make_clickable' pluggable to Avoid name conflicts for 'make_clickable' when integrating WP with other apps

Reopening, because I think you misunderstood the request.

As I understand the question, he's merely pointing out that this function exists in multitudes of applications. And that its name ought to be prefixed, e.g. wp_make_clickable(), or the whole function ought to be be wrapped around a function_exists() condition, to avoid conflicts from occurring.

Imo, it's reasonable to assume that any such function's signature would be the same as that of WP.

#3 follow-up: @westi
9 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

I didn't misunderstand the request.

I don't think we should be renaming all our functions to have a wp_ prefix which is the /only/ way to attempt to avoid this.

Renaming individual functions for cases like this is just going to lead to a load of code bloat as we still need to provide a wrapper function with the old name for backward compatibility.

#4 @jacobsantos
9 years ago

Reason #1 why you always prefix/namespace functions in any application / library.

#5 in reply to: ↑ 3 @hakre
9 years ago

Replying to westi:

I didn't misunderstand the request.

I don't think we should be renaming all our functions to have a wp_ prefix which is the /only/ way to attempt to avoid this.

Hmm, the request was to make it a plugable function and not to rename all functions for having nicer names.

And I really see no need to jump the gun on closing this ticket. First of all, I think it's a pretty valid request to make wordpress better integrateable with another very popular php board software. It think we should be more friendly here. I know tons of webmasters who want to combine blog and board on their sites and if some that simple change can make a difference, why not?

#6 @nacin
9 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.