Skip to content

Instantly share code, notes, and snippets.

View marktenney's full-sized avatar

Mark Tenney marktenney

View GitHub Profile
<?php
// List all user admin sites
// This is correctly listing the primary blog url
function get_primary_blog_url($id=null) {
// is there a user to check?
global $current_user;
$user_id = (null != $id ) ? $id : $current_user->ID;
if ( isset( $user_id ) ) {
// Get the blogs of this user
<?php
function dgtl_sermons_get_hook_data( $object, $field_name, $request ) {
$featuredimage = get_the_post_thumbnail( $object['id'], 'large', array( 'class' => 'post-featured' ) );
$postdate = get_the_date( 'F jS, Y' );
$user_id = get_post_meta( $object['id'], 'speaker' );
$user = get_userdata( $user_id );
$speaker = 'User display name: ' . $user->display_name . "\n";
.bg-info,
nav.navbar-dark {
background-color: #2f267c !important;
}
.navbar-dark .navbar-nav .nav-link {
color:#ffffff !important;
}
.navbar-dark .navbar-nav .nav-link:hover {
<?php
/*** Add a custom favicon for the admin area ***/
function custom_admin_favicon() {
$url = ''; // Place the path to your dashboard icon here.
echo '<link rel="Shortcut Icon" type="image/x-icon" href="' . $url . '" />';
}
add_action( 'admin_head', 'custom_admin_favicon' );
/*** Add a custom default front end favicon ***/
<?php
function fl_builder_events_loop_query_args_filter( $query_args ) {
$campus = rwmb_meta('campus') // Get the Campus of the page you are on from metabox value
if ( 'campus-events' == $query_args['settings']->id ) { // If the posts module has the ID 'campus-events'
$query_args['taxonomy'] = $campus; // Filter by events that also have the term of the same campus
}
return $query_args;
}
var curday;
var secTime;
var ticker;
function getSeconds() {
var nowDate = new Date();
var dy = 0 ; //Sunday through Saturday, 0 to 6
var countertime = new Date(nowDate.getFullYear(),nowDate.getMonth(),nowDate.getDate(),10,30,0); //10 out of 24 hours = 10am
var curtime = nowDate.getTime(); //current time
<?php
/*
Plugin Name: Connect Cards
Plugin URI: https://digitalchurchplatform.com
Description: Enable the Connect Card Content Library.
Version: 2.0
Author: Digital Church
Author URI: https://digitalchurchplatform.com
License: GPL2
*/
<?php
/*
Plugin Name: Blackline Client Portal
Plugin URI: https://blackline.limited/
Description: This is the client portal we use when we are actively designing and developing projects for clients.
Version: 1.0
Author: Blackline Branding Limited
Author URI: https://blackline.limited/
License: GPL2
*/
@marktenney
marktenney / custom-admin.php
Last active July 27, 2019 12:36
Add intercom messenger to any network users who have admin access.
<?php
/****** Add Intercom ********/
/****** Be sure to add your APP ID on lines 12 + 29 ******/
add_action('wp_enqueue_scripts', 'dgtl_enqueue'); // This action adds the messenger to the front end.
function dgtl_enqueue() {
if ( current_user_can('edit_posts') ) { // Only run messenger if user can edit posts (contributor+).
global $current_user;
$current_user = wp_get_current_user();
?>
@marktenney
marktenney / functions.php
Last active July 19, 2019 16:39 — forked from vegaskev/functions.php
Change Gravity Forms Spinner to CSS Spinner
// Changes Gravity Forms Ajax Spinner (next, back, submit) to a transparent image
// this allows you to target the css and create a pure css spinner like the one used below in the style.css file of this gist.
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; // relative to you theme images folder
}