Support » Plugin: Doc's Auto-tags » A bug found

  • Resolved Boris Kuzmanovic

    (@boris-kuzmanovic)


    Line 57:

    if ( strpos($post->post_content, $pattern))

    If your keyword is the very first word, strpos will return position 0, which will cause this to fail.

    Instead, it should be:

    if ( strpos($post->post_content, $pattern) !== false)

    Also, I prefer a case insensitive search. In that case:

    if ( stripos($post->post_content, $pattern) !== false)

    https://wordpress.org/plugins/docs-auto-tags/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Another bug found. This relates to non-functioning categories.

    Parameters are reversed in wp_set_object_terms function call. At around line 67, you’ll find:

    wp_set_object_terms( $post->ID, 'category', $categories, TRUE ); // TRUE means append

    with this one:

    wp_set_object_terms( $post->ID, $categories, 'category', TRUE ); // TRUE means append

    On the Settings page, use the category slug and it should work. For example:
    Pattern: Miles Davis
    Categories: jazz-slug

    Plugin Author John LeBlanc

    (@johnleblanc)

    Thanks very much for the fix, @boris! I’ve applied these changes and pushed version 0.7.

    Mahalo!
    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘A bug found’ is closed to new replies.