Skip to content

Instantly share code, notes, and snippets.

@machouinard
machouinard / budypress-xprofile-add-states.php
Created September 28, 2021 01:21 — forked from Garconis/budypress-xprofile-add-states.php
BuddyPress | xprofile add states as user dropdown field
<?php
/*
If you are using BP 2.1+, this will insert a State selectbox.
Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup
Remove this function after the field is created.
*/
function bp_add_custom_state_list() {
@machouinard
machouinard / wp-delete-trackbacks-pingbacks.php
Created April 9, 2022 07:08 — forked from kasparsd/wp-delete-trackbacks-pingbacks.php
Delete all WordPress trackbacks and pingbacks
<?php
$comments = get_comments( array(
'type' => 'pings',
'fields' => 'ids',
) );
foreach ( $comments as $no => $comment_id ) {
wp_delete_comment( $comment_id, true );
}