Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7057739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:01:34+00:00 2026-05-28T04:01:34+00:00

This is actually comes from a specific WordPress issue but there’s a more general

  • 0

This is actually comes from a specific WordPress issue but there’s a more general PHP point behind it which I’m interested to know the answer to.

The WordPress class is along these lines:

class Tribe_Image_Widget extends WP_Widget {
    function example_function(){
        // do something useful
    }
}

Is there any way in PHP that I can replace example_function() from outside the class?

The reason I want to do this is that the class is from someone else’s WP plugin (and has several functions in the class) and I want to continue receiving updates to the plugin but I want one of the functions adapted. If I change the plugin, then I’ll lose all my own changes each time. SO if I have my own plugin which just changes that one function, I avoid the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:01:34+00:00Added an answer on May 28, 2026 at 4:01 am

    It sounds like what you want to do is extend the class, and override that particular function.

    Class Your_Tribe_Image_Widget extends Tribe_Image_Widget
    {
       function example_function() {
         // Call the base class functionality
         // If necessary...
         parent::example_function();
    
         // Do something else useful
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes Eclipse comes up saying hey you should debug this line!!! but doesn't actually
I've recently come across this website. Now, is there any way I can actually
I understand that 2 options are available: Non-persistent Persistent But what does this actually
This is actually a non-critical question, but I get this warning most of the
My specific problem is actually not about the general translation of an OO interface
I'll try to be brief, but fully descriptive: This is Windows-specific. Using the Windows
I have been looking for an answer for this, but none seem to actually
This is more of a theoretical question than a specific one. I have a
There is a ton of information on how to do this, but since there
Simple question - what does this actually do? var oq = (ObjectQuery<TEntity>)L2EQuery; return ExecuteFirstorDefault<TEntity>(oq,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.