Use the save_post hook. Try something like:
function jude_classified_activity_entry( $post_id, $post, $update ) {
$slug = 'classified';
if ( $slug != $post->post_type )
return;
bp_activity_add(
// etc
);
}
add_action( 'save_post', 'jude_classified_activity_entry', 15, 3 );
Related Posts:
- WP JSON REST API (Ryan McCue) how to query posts with specific meta data with ‘AND’ relation?
- Creating two database tables via plugin
- Query Posts by Custom Field ‘Price’
- How to override normal WordPress search in Buddypress? [closed]
- Thumb rating for wordpress – top user
- Find out if request is for custom post type archive before query runs
- Fatal error: Uncaught Error: Call to undefined function get_userdata()
- How use %like% in sql statement wordpress
- medoo framework in WP plugin
- WordPress logo upload option in theme panel
- Accessing GET variable named ‘error’
- Possible to add a language file to a plugin without adding .po/.mo files to plugin directory?
- Two people sharing user in WordPress [closed]
- How can i list random post from multiple category?
- how do i remove posts from a WP_Query so the pagination is right?
- Accessing post’s meta data based on user’s click of a post
- Get posts from WP_Query and format them on admin_head
- How to query the custom fields by language?
- rt media plugin count not working in shortcode [closed]
- switched from query_posts to WP_query, not working now?
- AJAX search posts and pages
- How to change this WP_Query to get all ProductIDs and not only specific one?
- Add An Activity Filter By User Id In Buddypress Plugin
- Buddypress – Add the post_id in the bp_activity_add function
- After plugin activation all users marked as Spam
- How to call WordPress function other files
- Insert content of a post into another
- WP_Query and NULL meta keys
- how to use in custom single.php template using php?
- WordPress page and plugin list using sql query
- How to create a custom shortcode based on the layout?
- media page returnig to 404 in rtmedia [closed]
- WooCommerce search products between price range using WP_Query
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- Duplicate New User Registration notices (BuddyPress and bbPress both installed)
- How to get a list of bundled products using wp_query in woocommerce
- Remove / overwrite some functions in buddypress.js
- WordPress Apply filter in plugin causes 500 internal error
- Error in pdf generating plugin using FPDF
- Return multiple values in a shortcode attribute
- Loop returns the current page’s permalink and guid instead of the post in the loop
- How to override the Buddypress bp-members folder’s file?
- Add user meta after a user has registered and logged In [closed]
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- BuddyPress: filter member based on Xprofile Field
- override function from my plugin [closed]
- Delete data from custom table when deleting a post
- How to enable WPML in BuddyPress Multilingual Plugin in a single website? [closed]
- Do WordPress plugins suport multisite site?
- Pagination not working
- How to find the WordPress Nextgen galleries which are not used in WordPress posts?
- Bulk User Deletion
- Summary and Comments on Main landing Page
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- Woo-commerce Update price as a Bulk from My offline software export
- How to search post titles with whole words only, but not the exact word only?
- Use get_pages() before another plugin modifies it
- how to display recent post by category on home page
- How to Join wp_posts & wp_postmeta table using custom query
- What database state changes happen after a post is manually “updated” with no changes?
- any word search WordPress
- Warning: call_user_func_array() problem can anyone help with it?
- Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php
- Only return taxonomies that are linked to a category & product
- How to add specific posts to specific pages in WordPress?
- How to use information from the database in the front-end?
- User Following System
- How to fix slow comment query?
- There was a problem uploading the cover image in buddypress, while uploading profile image?
- ACF Query result in a new td (echo)
- Multiple Meta key in search
- History of page, interval of years
- How to insert variable which contain array value in wp_options table?
- Trending Tags based on post views
- Plugin does not create a custom table upon activation
- Action hook “wp_insert_post” works but not for last imported post
- Second foreach loop breaking (Posts2Posts)
- Ger posts from similar tags and categories
- WordPress filter function using query modifications
- Edit Buddypress Groups Activity Page Text [closed]
- How to Change MU/BuddyPress Group Blog New Installation Defaults [closed]
- wpdb get_var is not returning any result (verified mysql query returns only one value)
- WP-Snap too slow (caused by WP_Query?)
- WordPress Meta Query: Relation is not working correctly
- WordPress ultra slow if I click on posts?
- Insert data in custom table during new post creation
- Include subtitle display to slideshow
- Checking url from plugin [duplicate]
- Make buddypress posts likes count show to all users [closed]
- Buddypress Plugin for register user from other site’s [closed]
- I want to remove the register/login WordPress top bar from my website
- how to set approval of admin for wordpress posts submitted by the user?
- BuddyPress group filter
- Different login and logout for wp-admin while using buddypress
- I want to display data last 7 days with date wise in chartjs?
- How to create a buddypress group automatically if a topic is created
- What is the easiest way to create a custom field archive?
- WP_Query does not return the result even if the data is present in the database
- Show the author only own types of publications. (JetEngine, Elementor)
- Randomly display activity posts on home page with buddypress