Skip to content

Instantly share code, notes, and snippets.

@chaance
chaance / wp-team-post-save-link-user.php
Last active June 12, 2018 15:01
Function to dynamically sync CPT team posts with WP users. The post type requires custom meta fields for linked_author (user ID) and email.
<?php
/**
* Helper funnction to remove name suffixes.
*
* @param string $name Name.
* @return array Suffix-free name parts.
*/
function xx_get_suffix_free_name_parts( $name ) {
// Format first and last names.
$parts = explode( ' ', (string) $name );
@scottmagdalein
scottmagdalein / clickable-element.html
Last active March 15, 2023 18:01
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>
<!doctype html>
<html lang="en" class="breakpoint-medium">
<head>
<meta charset="utf-8">
<title>Metaquery Boilerplate</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<meta name="breakpoint" content="small" media="(max-width: 480px)">
<meta name="breakpoint" content="medium" media="(min-width: 481px) and (768px)">