Skip to content

Instantly share code, notes, and snippets.

@champsupertramp
champsupertramp / Ultimate Member 2.1 - Add search & reset buttons in member directory
Last active Apr 28, 2020
Ultimate Member 2.1 - Add search & reset buttons in member directory
View Ultimate Member 2.1 - Add search & reset buttons in member directory
<?php
add_action("um_members_directory_head","um_custom_members_directory_head",10, 1 );
function um_custom_members_directory_head( $args )
{
?>
<div class="um-search-submit" style="margin:auto;width:50%;">
<div style="width: 40%;float:left;margin:10px;text-align:center;">
<a href="#" class="um-button um-do-search" ><?php _e("Search","ultimate-member"); ?></a>
</div>
View gist:4f0fb734dd8f2243f51f8c9e44501704
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Scripts
*
* @since 1.0
@champsupertramp
champsupertramp / gist:d13302363caa36f2ae8a9281208d5b12
Last active Jan 31, 2021 — forked from ultimatemember/gist:5f725bff6bcf79d2988e
Ultimate Member 2.0 - Real-time notification - Add custom notification type
View gist:d13302363caa36f2ae8a9281208d5b12
/*
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
*/
@czachor
czachor / wp_usermeta.md
Last active Jun 30, 2021 — forked from magnific0/wp_usermeta.md
Show and Edit User Meta in Wordpress
View wp_usermeta.md

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).

@1activegeek
1activegeek / healthchecks.sh
Last active Jun 14, 2019
Healthchecks.io Bash Script
View healthchecks.sh
#!/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/)
@nikitasinelnikov
nikitasinelnikov / hide current user from all member directories
Created Dec 1, 2017
Ultimate Member Hide current user profile from Member Directory using Hooks
View hide current user from all member directories
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;
@poripa
poripa / sp-gallery.php
Created Jan 8, 2017
Ultimate Member Gallery: Hide the Gallery Tab on the profile page of specific roles
View sp-gallery.php
@ultimatemember
ultimatemember / gist:78aac8b268b2c75489f0
Last active Feb 17, 2020
Apply your own custom validation to a field
View gist:78aac8b268b2c75489f0
/*
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
@pryley
pryley / UltimateMembersMods
Created May 4, 2015
This Wordpress plugin adds custom features and modifications to the Ultimate Member plugin family.
View UltimateMembersMods
<?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:8cdaf61e7bd9de35512c
Last active Apr 19, 2021
Extending Ultimate Member Profile Menu using Hooks
View gist:8cdaf61e7bd9de35512c
/* 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',
);