MU Advanced: Issues and Discussion
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 03, 2010, 11:58:44 AM
Home Forums Contact Tags FAQ Links News Login Register
* *
Navigation Menu
Search

Random Quotes
Any sufficiently advanced technology is indistinguishable from magic.
- Arthur C. Clarke
Pages: [1]   Go Down
  Print  
Author Topic: How to make a function plugable  (Read 1390 times)
0 Members and 1 Guest are viewing this topic.
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« on: May 23, 2008, 01:01:50 PM »

Greets:

Is there any method of using a plugin to override a function call? (ie make it plugable?)

I'm trying to redo the function call get_the_author_url() and repoint it to the author's profile page located elsewhere.  Do I just use it in a plugin or should I just edit the core file?

I'm leaning towards just editing the core file but that means having yet another file not be replacable during upgrade time.

thanks,
-drmike
Logged

Andrew
CTO
Full Member
***

Karma: 3
Offline Offline

Posts: 201


View Profile
« Reply #1 on: May 23, 2008, 01:16:04 PM »

Unless 'get_the_author_url' is wrapped with function_exists in the core you'll probably have to make a hack.

To my knowledge you can't have a function take precedent over another identical function. Anyone?

Thanks,
Andrew
Logged
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #2 on: May 23, 2008, 02:32:21 PM »

It would depend on when that function is loaded. If a plugin could be loaded before that function, then you could wrap the original one in a check for function_exists.

OTOH, if that function has a filter/action hook, you can do anything with it.

Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #3 on: May 23, 2008, 02:53:22 PM »

OK, that makes sense.  The function does not have a function_exists wraped around it so it looks like my only option is a hack.  That's what I was thinking but just wanted to make sure.

thanks,
-drmike
Logged

Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #4 on: May 23, 2008, 06:01:28 PM »

It doesn't have a filter with it? I was thinking it did for some reason.
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #5 on: May 24, 2008, 12:57:02 PM »

It doesn't have a filter with it? I was thinking it did for some reason.


It does I believe but it's just for the test of the link I believe.

I'll look at it again on Monday.  Only 4 hour library time today and tomorrow due to the colleges being out.  i may get email done.

Let me throw this out though for a second opinion.  I'm thinking about linking the author name for posts to a profile page off of the main blog.  (Like how wp.com does categories but for author names.)

And then have the profile pages list the user's blogs, recent posts, comments and the like.  Like a myspace profile page.

yes?  no?  Opinions?

thanks
Logged

Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1627


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #6 on: May 24, 2008, 01:07:11 PM »

Kinda workin' on something like that myself. One for regular WP via hacked plugins and at some point one for MU via a client request.
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #7 on: May 24, 2008, 01:09:24 PM »

I'm wondering if a link leading away from the blog would be an issue.  It is when categories is used.  I'm wondering if it would be in this case since we're going from something that the author had written to something else by the author (ie their profile page) instead of something sitewide like wp does categories.
Logged

Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #8 on: May 24, 2008, 03:02:21 PM »

Been working on something similar to this myself as well.

Although not doing so from the users blog, but only through sitewide stuff.

For the other, I'm modifying the page rendered within the blog to do the same thing. Only difference is that it would be on the actual blog, and not through sitewide stuff.

Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1627


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #9 on: May 25, 2008, 06:16:41 PM »

Um yeah. Just make it a profile Page, with maybe a special page template or sumpthin'.
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
Tags:

Pages: [1]   Go Up
  Print  
 
Jump to:  


Login
 
 
Recent Posts
Recent Topics
No new topics.
Hot Tags
Whos Online
8 Guests, 0 Users
Home Forums Contact Tags FAQ Links News Login Register