PHP notice when using aioseo_description filter
-
I’m using the
aioseo_descriptionfilter to change descriptions based on certain criteria. However, within this function, it’s throwing 2 PHP notices. I’m doing pretty much the exact same thing with theaioseo_titlefilter, and that function isn’t throwing any notices regarding thepost_nameorpost_parent. Any ideas why these 2 notices would be happening?PHP Notice: Trying to get property 'post_name' of non-object in /srv/htdocs/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 10PHP Notice: Trying to get property 'post_parent' of non-object in /srv/htdocs/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 13Here is the function:
https://gist.github.com/Garconis/d4ef0e08835e25cef38258399af8ecfc
Despite the PHP notice, the function is actually working, but I’m hoping to clear up the notice so it doesn’t log it on every page load.
The topic ‘PHP notice when using aioseo_description filter’ is closed to new replies.