Skip to content

Instantly share code, notes, and snippets.

View lenasterg's full-sized avatar

Lena Stergatou lenasterg

View GitHub Profile
@webtoffee-git
webtoffee-git / functions.php
Last active January 16, 2024 07:36
Import/Export BuddyPress Users-WordPress Users/Customers Import/Export
<?php //Do not copy this line of code
add_filter('wt_user_alter_csv_header', 'wt_user_alter_csv_header');
add_filter('hf_customer_csv_export_data', 'hf_customer_csv_export_data');
add_action('wt_customer_csv_import_data', 'wt_customer_csv_import_data',10,2);
add_filter('wt_iew_alter_export_data', 'wt_iew_alter_export_data',10,6);
add_filter('wt_user_importer_pre_parse_data', 'wt_user_importer_pre_parse_data');
function wt_user_alter_csv_header($row) {
@modemlooper
modemlooper / custom-notification.php
Last active December 5, 2025 20:17
BuddyPress add custom notification
<?php
// this is to add a fake component to BuddyPress. A registered component is needed to add notifications
function custom_filter_notifications_get_registered_components( $component_names = array() ) {
// Force $component_names to be an array
if ( ! is_array( $component_names ) ) {
$component_names = array();
}
// Add 'custom' component to registered components array
@jplhomer
jplhomer / disable-comments.sh
Created February 25, 2015 16:38
Disable all comments/pings in WordPress with WP-CLI
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
@daverogers
daverogers / footer.js
Created April 12, 2013 22:41
Assign "active" class to navbar item based on current page URL with jQuery
@wilmoore
wilmoore / Url.php
Created July 21, 2011 15:03
Custom Zend Framework Url Helper (honors existing query string -- works well for pagination links, etc.)
<?php
/**
* @copyright ...
* @author Wil Moore III <wil.moore@wilmoore.com>
*/
use Zend_View_Helper_Url as Url;
/**
* View Helper to attach a query-string to URL