Functions - callback vs fallback

admin2025-04-17  1

While seeing the source code of some themes or plugins, I have noticed that, sometimes these two words are used to denote/indicate other functions.

What's the difference between them? Which function should be called callback function and which is fallback?

Can you give me an example?

Thanks in advance.

While seeing the source code of some themes or plugins, I have noticed that, sometimes these two words are used to denote/indicate other functions.

What's the difference between them? Which function should be called callback function and which is fallback?

Can you give me an example?

Thanks in advance.

Share Improve this question asked Oct 4, 2016 at 9:31 mukto90mukto90 1,60014 silver badges18 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 5

That is not really a question in the focus of WordPress, is also in other programming languages and in our speaking language a topic. Maybe I can clear the difference between these words with a non coding example.

Callback

A return of a situation to a state. Like a call with the telephone to a message of the phone or the answering machine to a defect of a product.

In the coding context is a callback a function/method which executed after the current effect is finished.

Fallback

An act of falling back. Like an alternative plan to the current idea, progress.

In context of the computer is a fallback typically a backup of the current data to fallback to a time stamp.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744857057a270891.html

最新回复(0)