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_query parameters for date range
- insert data in database table from plugin with WP3.1
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- How to notify users of blog updates a la Admin Plugin Update notifications?
- Comparisson between date() and a date from wp_postmeta
- Find out if request is for custom post type archive before query runs
- How to extract images of post and pages excluding header and logo image in wordpress?
- How to count number of records found in a database table?
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- Advanced Custom Fields query
- plugin to search entire posts, blogs, forum, users [closed]
- Can I run multiple queries with $wpdb->prepare?
- How use %like% in sql statement wordpress
- How to get member list based on role by using buddypress?
- WP_Query ordering numbers as letters
- FacetWP group listings by custom field [closed]
- Wp favorite posts get user favorites in profile using buddypress [closed]
- WooCommerce shop page orderby [closed]
- Not getting author rank when using return
- How do I “get the next 10 posts after post_id == x”?
- rt media plugin count not working in shortcode [closed]
- AJAX search posts and pages
- Integrate BuddyPress & Facebook
- DROP TABLE with uninstall hook not working
- After plugin activation all users marked as Spam
- How to create a custom shortcode based on the layout?
- Using AJAX to generate front end / viewer end pages
- Implementing an image hosting website using WordPress? [closed]
- WooCommerce search products between price range using WP_Query
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- 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
- Meta query for comparing two dates
- 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
- BuddyPress admin bar links are broken [closed]
- Using BuddyPress > ‘Register page’ [closed]
- 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
- 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 Join wp_posts & wp_postmeta table using custom query
- What database state changes happen after a post is manually “updated” with no changes?
- Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php
- adding dynamic/multiple slug values in ‘option_none_value’
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- How to pass multiple custom fields as shortcode’s parameters
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Is it possible to custom set query for a WordPress REST API response?
- 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 do I add languages?
- ACF Query result in a new td (echo)
- Multiple Meta key in search
- wp_schedule_event function reference
- History of page, interval of years
- Plugin does not create a custom table upon activation
- How can i see/log all requests coming from a registration form (not from the UI)?
- Second foreach loop breaking (Posts2Posts)
- Advanced Custom Fields (ACF) Plugin – Random Image in Sidebar
- Ger posts from similar tags and categories
- wp_query for more fields plugin
- WordPress filter function using query modifications
- 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
- how do you point ‘screen_function’ to a function in the same class? [closed]
- Making a Custom Post Type Publish Loop
- 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]
- How can I save a setting field with multiple checkbox options generated by a foreach loop on a custom wordpress admin page?
- 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?
- Order custom post type by posts with most likes first
- How to create a buddypress group automatically if a topic is created
- Accessing Correct Database to Create REST API Endpoint