BuddyPress Edit activity function good practice

Looking at https://buddypress.trac.wordpress.org/browser/trunk/src/bp-activity/bp-activity-functions.php there’s several functions: Activity Meta I found bp_activity_add_meta, bp_activity_delete_meta and bp_activity_update_meta in that file, e.g. bp_activity_update_meta: // Update activity meta counts. if ( bp_activity_update_meta( $activity_id, ‘favorite_count’, $fav_count ) ) { Activities It looks like these can be updated the same way wp_insert_post can be used to update a post, by calling bp_activity_add … Read more

How to add fee_lines using woocommerce rest API v3?

Here is my code that working fine. “fee_lines”: [ { “name”: “7.5% Booking Fee”, “tax_status”: “taxable”, “tax_class”: “”, “total”: “26.02”, “total_tax”: “26.02”, “taxes”: [], “meta_data”: [] }, { “name”: “Waiter Tip (5%)”, “tax_status”: “taxable”, “tax_class”: “”, “total”: “8.00”, “total_tax”: “8.00”, “taxes”: [], “meta_data”: [] } ]

WP appending -2 to the end of my slug

It might not be a Page. WordPress is very picky about slugs sometimes. You might have to dig in the database’s wp_posts table and see what other post exists somewhere with that name – sometimes it can be an odd thing like a Media Library (image) file. Once you find it, if you completely delete … Read more

How to disable the single view / search /archive page for a already-built custom post type?

this custom post type is created by a plugin, I can’t update the register_post_type code You can use either the register_post_type_args or register_<post type>_post_type_args hook to filter the post type args like the publicly_queryable in your case. See an example below which uses the former hook, where I also set exclude_from_search to true to exclude … Read more

counting slugs not working?

Now I’m however getting: Fatal error: Uncaught Error: Undefined constant “cat” That’s because the cat and post_tag were not wrapped in quotes (e.g. ‘cat’), and they also did not start with the dollar sign ($) as in $cat, which indicates a variable, hence PHP tried to find the constants named cat or post_tag, and when … Read more