Answer the question
In order to leave comments, you need to log in
Why does the action hook work, which is not in the documentation?
Hello! I'm getting into Wordpress and writing simple plugins... At the moment I'm smoking the topic of "hooks"... The
question arose:
1) we have filter the_title (namely, filter, this is important... dock
from the documentation:
apply_filters( 'the_title', string $title, int $id )
// код плагина
add_action('the_title', 'my_function');
function my_function($title){
$mytitle = $title.'-суффикс';
return $mytitle;
}
//do_action('the_title');
Answer the question
In order to leave comments, you need to log in
Because add_action is the same as add_filter with one peculiarity - the first one does not return anything, and the filter must return the first argument
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question