What version of wordpress are you using?
In recent releases of Add-Meta-Tags the add_filter() function that attaches the amt_custom_title_tag() filtering function to the wp_title filter hook has been set to send a second argument to the filtering function; the separator that is used between the various parts of the title.
There are two possible causes of this error:
1. The wp_title filter in the used WordPress version does not send the second argument.
Possible solutions:
a. I revert back to the one-argument version of the filtering function. BTW, the $separator variable is not used anyway.
b. You upgrade WP, which might be a problem in some cases.
2. The amt_custom_title_tag() function is called from a custom add_filter() statement somewhere in your theme’s functions.php (perhaps in order to change the priority) in a way that the second argument is not passed to the filtering function.
Possible solution: fix the custom add_filter() statement. The correct way to attach the amt_custom_title_tag() filtering function to the wp_title filter hook is the following:
add_filter('wp_title', 'amt_custom_title_tag', 1000, 2);
The last argument (number 2) is important.
If you need more help, post a question on the Github issue tracker (find the link on the description page) as I generally have stopped providing support on this forum.
Kind Regards,
George
Hi @kyarauk
I’d appreciate some feedback about this issue so as to know if I should go ahead and revert back to the old functionality or leave the filtering function as is.
Thanks in advance.
George
Hi George,
Apologies for the late reply.
I’ve not been able to fix the issue as of yet, so perhaps the old functionality would be the best approach.
Thanks,
Cat
Hey, thanks for getting back to me. I was preparing a new release and was wondering whether I should also fix this or not. Thanks for letting me know!
George
no worries, I shall update the plugin when you next release. Sorry it took me a while to reply!
Hi Cat, better late than never 🙂 I’ve reverted back to the old functionality in v2.9.6, which will be out really soon.
Thanks for your feedback!
George
v2.9.6 is out. I hope this is fixed now.
George
Great George, thanks it works now 🙂