WordPress.org

Ready to get started?Download WordPress

Forums

Automatic Post Tagger
What about custm taxonomies and categories? (23 posts)

  1. 3x7
    Member
    Posted 1 year ago #

    I use couple of plugins for adding tags and categories and custom taxonomies, but non of them has the functionality to add several words for one tag...

    Is there a way to make it work for categories and custom taxonomies?

    http://wordpress.org/extend/plugins/automatic-post-tagger/

  2. Devtard
    Member
    Plugin Author

    Posted 1 year ago #

    I'll add your suggestions to my to-do list. The problem is that I have a lots of other ideas on the list so it may take some time before I implement these features (I am also considering releasing a new, more versatile plugin under a different name). Thanks for understanding.

  3. David M.
    Member
    Posted 1 year ago #

    This is a very promising plugin that I have already put to good use. Thanks and congratulations!

    As a feature request, I support what 3x7 said. It would be great if, instead of just tags, this plugin could assign any taxonomy based on words found in the post.

    This is my use case: I publish lots of international news and I want them to be searchable by country. Sometimes the country is written into the contents (i.e. 'France'), but sometimes it is not (the content includes 'French', 'Paris', etc.). This plugin allows me to automate that tagging. But it would be even better if it could fill a location custom taxonomy.

    Thanks again!

  4. web559
    Member
    Posted 1 year ago #

    This is a great plugin concept. I would also *love* to see custom taxonomy support.

  5. Devtard
    Member
    Plugin Author

    Posted 1 year ago #

    Okay then. I am going to release two or three more versions of this plugin and after that I will start working on another plugin that will be able to handle other taxonomies, including custom ones.

    If you give this plugin 5 stars and share it with others, it will motivate me to work faster. :)

  6. 3x7
    Member
    Posted 1 year ago #

    David M.
    Great concept! I'm testing the similar thing on another project...

  7. 3x7
    Member
    Posted 1 year ago #

    How is it going on with category feature?

    I'm still fighting with combination of another plugin to set categories automatically and your plugin for tags .. :S

  8. Devtard
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry I am not working on that feature yet, I have to implement all necessary functions first.

    I could give you a hint how to modify the script to make it work for categories if you are at least a bit familiar with PHP though.

  9. 3x7
    Member
    Posted 1 year ago #

    That would be great... I'm not a pro, but I know how to copy paste :)

  10. Devtard
    Member
    Plugin Author

    Posted 1 year ago #

    Well, this is not really about copy-pasting, it is a bit harder than that. :)

    In version 1.3 in the file automatic-post-tagger.php on line 714 begins a section where tags are being added to the post. So basically in order to add categories to a post you need to replace there the "post_tag" parameter with "category" - more information here: http://codex.wordpress.org/Function_Reference/wp_set_post_terms).

    Then it would add categories that are defined on the "tag" list in the admin interface.

    If you'll decide to use this modified version and also the original plugin, you will need to rename added option names and the custom database table. I recommend you doing that by replacing all ocurrences of the prefix "apt_" with whatever you want.

    It could be done more efficiently, though, but this is the easiest solution that I came up with. If you are not in a hurry, wait some time for my new plugin (but it may take months, depending on my laziness. :))

  11. 3x7
    Member
    Posted 1 year ago #

    what about rebuilding/cloning and renaming this plugin "categoriezer"?

  12. Devtard
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah, I could do that, but then I would have to make same updates for 2 plugins and the other one would not have universal use anyway. So when I finish working on APT I will make another plugin where you will be able to make any rules for any taxonomies (without changing the code).

    In the meantime you'll just have to use a copy of this plugin for adding categories, I think that changing one taxonomy name and all prefixes isn't that hard, is it? ;)

  13. 3x7
    Member
    Posted 1 year ago #

    I'll try it out these days...

    thanks allot!

  14. archon810
    Member
    Posted 1 year ago #

    Another vote for categories.

    I specifically would like to support adding categories based on shortcodes too (so filter should run early). For example [embed] -> Videos category.

  15. balticdesign
    Member
    Posted 1 year ago #

    To get the plugin to work with post types you need to find all instances of "post" and replace with "your-custom-post-type".

    BEWARE - Don't replace "POSTS" or anything similar - just "post"

    As Devtard has mentioned it is also relatively easy to modify this for categories.

    replace there the "post_tag" parameter with "category"

    However if you look at http://codex.wordpress.org/Function_Reference/wp_set_post_terms

    You will notice: "Hierarchical terms must always pass the id rather than the term name to avoid confusion where there may be another child with the same name."

    This presents a problem as unlike tags categories need to be set with their ID's

    Look for ## ADDING TAGS TO THE POST around line 891

    Add something like:

    `foreach ($apc_tags_to_add_array as $apc_cat) {
    $term = get_term_by('name', $apc_tag, 'category');
    $apc_tag_ids[] = $term->term_id; }`

    This will find the category id's and output them as an array again:
    $apc_tag_ids
    Then around line 898 / 899 we have:

    wp_set_post_terms($post_id, $apc_tags_to_add_array, 'category', true); //append tags

    Replace with:

    wp_set_post_terms($post_id, $apc_tag_ids, 'category', true); //append tags

    Repeat this on the same function immediately below.

  16. 3x7
    Member
    Posted 1 year ago #

    Thanks for your help!

    I'm working on it right now, but there is another thing I'm trying to achieve:

    To make it look for keywords in specific custom field (not content,title,exceprt).

    I would be happy even if it goes thru all post custom field values and look for keywords...

    Any help?

    Cheers!

  17. 3x7
    Member
    Posted 1 year ago #

    This works!

    However it works only if the category exists in the categories it does not add new categories. (which is fine for me). Will have to try also with other taxonomies...

    !tnx again

  18. 3x7
    Member
    Posted 1 year ago #

    I realized it would be hard to set it to go thru custom fields, therefore is there a way to make it go thru "tags", so I would get categories based on tags allready attached to posts?

    Thank you!
    cheers!

  19. 3x7
    Member
    Posted 1 year ago #

    any news on custom taxonomies?

  20. Devtard
    Member
    Plugin Author

    Posted 1 year ago #

    One of the following versions will be using objects so changing taxonomies will be much easier than now. But the promissed plugin that would handle custom taxonomies by itself is still far away from its creation. Please be patient. :)

  21. bytesmasher
    Member
    Posted 11 months ago #

    Chiming in with another request for custom taxonomy support.

  22. uxicorp
    Member
    Posted 10 months ago #

    Hi 3x7 - would you mind sharing the modified plugin code with me? I too need to assign categories automatically and you'd save me a couple of days monkeying around to get the code right.

    Thanks!

  23. 3x7
    Member
    Posted 10 months ago #

    did you try
    http://wordpress.org/plugins/docs-auto-tags/

    if this doesent help you I'll dig the code out for u...

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.