"Missing argument 2 for filter_aioseop_title() " | Troubleshooting All in One SEO Pack Pro | Support | Semper Plugins

Avatar
Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
"Missing argument 2 for filter_aioseop_title() "
January 16, 2019
1:56 pm
Avatar
bas tegelaar
Member
AIOSEOP
Forum Posts: 7
Member Since:
April 24, 2018
sp_UserOfflineSmall Offline

Hello,

 

We have a plugin that uses a filter for aiseo, which used to work fine, but now it generates an error. So i was wondering if anything changed, which would cause this

The errror (in cpanel):

“Missing argument 2 for filter_aioseop_title() “

the code:

 

function custom_aioseop_description( $description, $post_id) {
if ( get_post_status( $post_id ) != ‘publish’ ) {
return $post_id;
}
if($description == Null){
$seotest = get_field(‘seodescrip’,$post_id);
$description = $seotest;
}

return $description;
}

add_filter( ‘aioseop_description’, ‘custom_aioseop_description’, 10, 1 );

 

January 16, 2019
2:10 pm
Avatar
Steve Mortiboy
Admin
Forum Posts: 2070
Member Since:
January 5, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

January 16, 2019
4:51 pm
Avatar
bas tegelaar
Member
AIOSEOP
Forum Posts: 7
Member Since:
April 24, 2018
sp_UserOfflineSmall Offline

Steve Mortiboy said
Hi Bas,

That error you see in cPanel does look to be related to your filter.  filter_aioseop_title doesn’t appear anywhere in the code you provided.  Does the cPanel error provide any more detail such as file and line number where the filter_aioseop_title code is located?

You may want to enable WP_DEBUG (https://codex.wordpress.org/Ed……php#Debug) so you can find more information such as where the error is coming from.  

Hello Steve,

Thank you for the reply.

I got errors for both the aiosep_title & description. (didnt post the correct combi though)

PHP Warning: Missing argument 2 for custom_aioseop_description() in mysite/autofill.php on line 6

PHP Warning: Missing argument 2 for filter_aioseop_title() in mysite/autofill.php on line 21

 

Line 6 = function custom_aioseop_description( $description, $post_id) {
Line 21 = function filter_aioseop_title( $title, $post_id) {

 

function custom_aioseop_description( $description, $post_id) {
if ( get_post_status( $post_id ) != ‘publish’ ) {
return $post_id;
}
if($description == Null){
$seotest = get_field(‘seodescrip’,$post_id);
$description = $seotest;
}

return $description;
}

add_filter( ‘aioseop_description’, ‘custom_aioseop_description’, 10, 1 );

function filter_aioseop_title( $title, $post_id) {
$pagetitleseocompare = get_the_title($post_id);
if($title == $pagetitleseocompare){
$seotitle = get_field(‘seotitle’,$post_id);
$title = $seotitle;
}

return $title;
}

add_filter( ‘aioseop_title’, ‘filter_aioseop_title’, 10, 1 );

January 16, 2019
6:21 pm
Avatar
Steve Mortiboy
Admin
Forum Posts: 2070
Member Since:
January 5, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

January 17, 2019
3:26 am
Avatar
bas tegelaar
Member
AIOSEOP
Forum Posts: 7
Member Since:
April 24, 2018
sp_UserOfflineSmall Offline

Hello Steve,

 

Yes that is correct, a few weeks ago i asked if it was possible to update the AISEO title (database) field with php/a plugin, and was told no, so this is a workaround for that.
now pages generate a seo title/description in an advanced custom fields field, and that gets outputted by this filter  (and that part works, it just generates 10.000 errors)

January 17, 2019
10:31 am
Avatar
Steve Mortiboy
Admin
Forum Posts: 2070
Member Since:
January 5, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

Forum Timezone: America/New_York
Most Users Ever Online: 964
Currently Online:
33
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Member Stats:
Guest Posters: 35
Members: 21719
Moderators: 0
Admins: 8
Forum Stats:
Groups: 4
Forums: 28
Topics: 2027
Posts: 8767
Newest Members:
Lesley Wells
Administrators: Michael TorbertPeter BayliesSupport TeamSteve MortiboyMatthew RobinsonSteve Klasen, Arnaud: 198Ashish Ravi
[i]
[i]
Skip to toolbar