Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
ipedrazas / gist:2c93f6e74737d1f8a791
Created September 18, 2014 22:13
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@ultimatemember
ultimatemember / gist:8cdaf61e7bd9de35512c
Last active April 19, 2021 20:35
Extending Ultimate Member Profile Menu using Hooks
/* First we need to extend main profile tabs */
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {
$tabs['mycustomtab'] = array(
'name' => 'My custom tab',
'icon' => 'um-faicon-comments',
);
@pryley
pryley / UltimateMembersMods
Created May 4, 2015 22:45
This Wordpress plugin adds custom features and modifications to the Ultimate Member plugin family.
<?php
/**
* Plugin Name: Ultimate Member Modifications
* Plugin URI: http://geminilabs.io
* Description: This plugin adds custom features and modifications to the Ultimate Member plugin family.
* Version: 1.0.0
* Author: Gemini Labs
* Author URI: http://geminilabs.io
* License: MIT License
*/
@ultimatemember
ultimatemember / gist:78aac8b268b2c75489f0
Last active September 13, 2022 11:58
Apply your own custom validation to a field
/*
In this code sample, you can learn how to apply custom
validations on any fields you want.
This can be done using these steps:
1. Edit the field in backend (field modal)
2. Where it asks for field validation choose "Custom"
3. Enter a unique validation action name e.g. my_8numbers
@poripa
poripa / sp-gallery.php
Created January 8, 2017 09:09
Ultimate Member Gallery: Hide the Gallery Tab on the profile page of specific roles
@nikitasinelnikov
nikitasinelnikov / hide current user from all member directories
Created December 1, 2017 10:48
Ultimate Member Hide current user profile from Member Directory using Hooks
add_filter( 'um_prepare_user_query_args', 'um_remove_current_user_from_list', 100, 2 );
function um_remove_current_user_from_list( $query_args, $args ) {
if ( is_user_logged_in() ) {
if ( ! empty( $query_args['exclude'] ) )
$query_args['exclude'] = array_merge( $query_args['exclude'], array( get_current_user_id() ) );
else
$query_args['exclude'] = array( get_current_user_id() );
}
return $query_args;
@1activegeek
1activegeek / healthchecks.sh
Last active May 19, 2022 13:53
Healthchecks.io Bash Script
#!/bin/bash
## Checks get listed here as variables with a call to their respective command
## Sub token with Organizr API token
radarr=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/radarr)
sonarr=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/sonarr)
ombi=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/requests)
plex=$(curl -L -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/plex)
domain=$(curl -o /dev/null -s -w "%{http_code}\n" -H "token: token" https://domain.com/)
@czachor
czachor / wp_usermeta.md
Last active June 30, 2021 08:24 — forked from magnific0/wp_usermeta.md
Show and Edit User Meta in Wordpress

Show and Edit User Meta in WordPress (works with UltimateMember)

Description

This simple procedure will allow you to:

  1. Display user meta fields under in the user list as additional columns (Users > All Users).
  2. Display these fields on user profiles.
  3. Edit these fields under user edit.

This method works completely without plugins and involves just some functions and hooks in functions.php. Plugins like "User Meta Display" achieve this to some level, but treat custom meta fiedlds completely different from the regular fields. They are shown and edited in seperate environment and fail to show the meta data is a table list. This method integrates custom user meta along with regular user (meta).

@champsupertramp
champsupertramp / gist:d13302363caa36f2ae8a9281208d5b12
Last active February 14, 2023 14:37 — forked from ultimatemember/gist:5f725bff6bcf79d2988e
Ultimate Member 2.0 - Real-time notification - Add custom notification type
/*
This code sample shows you how to use the API to create
and add custom notifications (for real-time notifications)
plugin.
STEP 1: You need to extend the filter: um_notifications_core_log_types with your
new notification type as follows for example
*/
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Scripts
*
* @since 1.0