WordPress.org

Ready to get started?Download WordPress

Forums

WP-Activity
Custom post type support? (8 posts)

  1. stl99
    Member
    Posted 2 years ago #

    Hi,

    Thanks for the plugin!!

    I really like the export feature of your plugin but I need to track custom post types as wells - any chance you will add this anytime soon? Is there maybe a hack available until then?

    Cheers,
    Thomas

    http://wordpress.org/extend/plugins/wp-activity/

  2. Miguel Peixe
    Member
    Posted 2 years ago #

    Hey stl99,

    I was wondering that too. Apparently this code on your functions file should do the trick:

    add_action('publish_{$post-type}', 'act_post_add');
    add_action('{$post-type}_updated', 'act_post_update');
    add_action('delete_{$post-type}', 'act_post_del');

    But for some reason it creates a duplicate entry for publish, no entry for updated and the delete works fine.

    Any ideas?

  3. Miguel Peixe
    Member
    Posted 2 years ago #

    Oh, and {$post-type} should be replaced with your custom post type

  4. Dric
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    It seems like there is no action hook for modified custom type posts.
    I still can't understand why custom type posts are not processed the same way as regular posts.

    @Miguel : Do you know in wich WordPress file is the do_action('publish_{$post-type}') ? I can't find it.

  5. Miguel Peixe
    Member
    Posted 2 years ago #

    Hi Dric,

    The action hook is actually this one:
    add_action('{$new_status}_{$post->post_type}', 'your_function');

    It's suppose to work just like the post action hook (used in WP-Activity). Still looking for a solution.

  6. Miguel Peixe
    Member
    Posted 2 years ago #

  7. Dric
    Member
    Plugin Author

    Posted 2 years ago #

    I found the code :

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    With 'transition_post_status' action, I should be able to handle custom type posts as well as regular posts.
    But for updated custom type posts...

  8. Miguel Peixe
    Member
    Posted 1 year ago #

    Any news on this matter?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic