I create a function in wordpress function.php, but I get an error:
Argument 2 missing for get_appcara_child () in C: \ wamp \ www \ appcara \ wp-content \ themes \ appkara \ functions.php on line 617
The function gives the correct output, but I do not know why it displays this warning.
My .php function
add_action( 'init', 'get_appcara_child',2 ); function get_appcara_child($post,$parent) { echo $post; echo $parent; }
Call on page .php
$child= get_appcara_child($post->ID , $post->post_parent);
source share