Avatar of Robert Granlund
Robert Granlund
Flag for United States of America asked on

Add Function to another class

I'm learning some stuff about PHP PDO and Wordpress functions, hooks and Classes.

I have an abstract question.  In Wordpress is it possible to add a function to a class in a plugin?

Meaning, Can I create a plugin that defines a function and then have that function be added to a specific class within another plugin?
WordPressProgrammingPHP

Avatar of undefined
Last Comment
Robert Granlund

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
eemit

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Robert Granlund

ASKER
Not sure I'm clear here.  What I want to do is create a plugin that adds a Method to a Class that is in another Plugin.

I know how to create a plugin, just not sure how to write the Action to add a method to a class.
Robert Granlund

ASKER
Thanks to both of you.  After reading everything through for the umteeth time and feeling like I really understand, but can't figure out what was wrong, I finally realized.  In one of the functions it was calling the class and then the function and all I needed it to do was to call my new function instead.  Kind of an "Oh Geez " Moment.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy