WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Strange error message - plug in not working (23 posts)

  1. rick4him
    Member
    Posted 2 years ago #

    I'm getting a strange message:

    Warning: Missing argument 2 for standard_process_link_post_format_title() in /home/downsynd/public_html/noahsdad.com/wp-content/themes/standard/functions.php on line 2713

    Lots of them actually. They show up above the link to the posts. What's going on?

    Thanks.

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Rick,

    It seems that it's your theme what is causing the error, see:

    /home/downsynd/public_html/noahsdad.com/wp-content/themes/standard/functions.php

    The functions.php file belongs to your theme, WordPress Popular Posts has nothing to do with that my friend.

  3. jca325
    Member
    Posted 2 years ago #

    I'm having the same error and contacted the author's of the theme that Rick and I have -- Standard 3, one of WordPress's finest.

    They informed me that the second argument is there and that it is actually an issue with the plugin.

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Would need to get the theme a run some tests. It's kinda hard to debug something without testing. Can you please provide the URL of this theme so I can check it out?

  5. jca325
    Member
    Posted 1 year ago #

  6. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the link. However, since this theme can't be downloaded for free there's not much I can do. Sorry.

  7. jeremyers1
    Member
    Posted 1 year ago #

    Rick or jca325,

    Did you ever figure this out? I am having the same problem.

  8. jeremyers1
    Member
    Posted 1 year ago #

    By the way,

    Over on another plugin with similar errors, the correction was this:

    --Seems that a "the_title filter fix" was needed.

    http://wordpress.org/support/topic/plugin-testimonials-widget-warning-missing-argument-2?replies=5

    Can "the_title filter fix" be added to this plugin?

  9. jeremyers1
    Member
    Posted 1 year ago #

    I did a little research and then tweaked the following two lines of wordpress-popular-posts.php

    $title = apply_filters('the_title', $title);
    $title_sub = apply_filters('the_title', $title_sub);

    to this:

    $title = apply_filters('the_title', $title, $id);
    $title_sub = apply_filters('the_title', $title_sub, $id);

    I am not sure exactly what this does, but the error message has gone away...

  10. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jeremy,

    Thanks for the notice. Just checked the thread you linked to and the developer said this:

    Is it a widget having the trouble? If so, my trouble was using the wrong filter. The correct looks like the following.

    $title = apply_filters( 'widget_title', $instance['title'], null );

    Since I can't reproduce the problem, could you please test that for me?

  11. jeremyers1
    Member
    Posted 1 year ago #

    Hector,

    No, that didn't work. Same error message.

    Adding the $id to each of the lines as in my comment above did get rid of the error message, and when I went to inspect the function that is being affected, argument 2 is indeed "$id".

  12. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Alright, thanks Jeremy! I'll make sure to have your fix included on the next release.

    Thank you!

    P.S.: the $id variable in that specific part of the code is missing in the last version of the plugin, so I'm guessing the filter is taking it as null.

  13. jca325
    Member
    Posted 1 year ago #

    Thanks for figuring this out!

  14. siutouamy
    Member
    Posted 1 year ago #

    Hector, are you have this message with either the Most Commented or Similar Post plugin? Because I just changed to the Standard theme and encountered this message with both.

  15. siutouamy
    Member
    Posted 1 year ago #

    In case anyone wonders, I got through the Most Commented Widget plugin by changing this line:

    $post_title = apply_filters( 'the_title', $post->post_title, $this);

    to this:

    $post_title = apply_filters( 'the_title', $post->post_title, $this->id );

  16. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    It seems to be a bug caused by either the theme or WordPress itself, but more likely by the theme as it doesn't occur with Twenty Eleven or any other theme I have tested.

    I will, however, include this modification in the next release.

  17. siutouamy
    Member
    Posted 1 year ago #

    This is what they have on their forum

    We have had a few users report issue with this function, so we thought we would create a FAQ explaining what is going on here.

    This usually emanates from activating a new plugin where the new plugin is is adding a filter on the_title, like the "standard_process_link_post_format_title" function within Standard is too.

    The error here is that the plugin is not passing in the second argument, the "id", to the "the_title" filter. WordPress states, according to the Codex entry, that the second parameter, again the "id", must be passed in as an argument and Standard enforces that.

    If you are experiencing issues with this error / warning, you will need to contact the plugin developers and ask them to fix the issue in their plugin to properly include the second argument.

    Of course we could "patch it" so that it "works", but we have no plans to do that. We are not trying to be mean, but we are asking developers to code to a higher standard.

  18. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    I see. However that doesn't explain why the bug doesn't show up on WordPress' Twenty Ten & Eleven themes which I use to test the plugin since these were built following WordPress' coding standards.

    Funny, huh?

  19. siutouamy
    Member
    Posted 1 year ago #

    I know...
    it's bizarre. Plus, the error is occuring with a number of other plugins... some of which haven't been updated in over two years.

  20. Tyler
    Member
    Posted 1 year ago #

    I was having this issue with the premium theme 'Standard' and fixed it by changing line 2769 of the functions.php theme file to:

    add_filter( 'the_title', $title, $id, 'standard_process_link_post_format_title', 10, 2 );

  21. jeremycaris
    Member
    Posted 1 year ago #

    I was having this same issue while integrating WooCommerce with my Standard theme. Tyler's fix works perfectly:

    I was having this issue with the premium theme 'Standard' and fixed it by changing line 2769 of the functions.php theme file to:

    add_filter( 'the_title', $title, $id, 'standard_process_link_post_format_title', 10, 2 );

  22. jeremyers1
    Member
    Posted 1 year ago #

    Tyler,

    I recently upgraded to Standard 3.2.2, and was having this problem, but the line number in functions.php seems to have changed. Do you know what the original filter looked like?

    I am guessing that the the original add_filter looked like this:
    add_filter( 'the_title', 'standard_process_link_post_format_title', 10, 2 );

    and you changed it to
    add_filter( 'the_title', $title, $id, 'standard_process_link_post_format_title', 10, 2 );

    Is that right? If so, it looks like it is now on line 3097

    Even then, I cannot seem to get it work.

  23. jeremyers1
    Member
    Posted 1 year ago #

    It looks like my problem was actually a plugin conflict... The problem was with "Combine JS" plugin, by Convoy. I disabled that plugin, and all is back to normal now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.