This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Setup ACF Pro to use a license key in wp-config | |
# | |
# 1. Place your license key in a file called .acf-license-key somewhere your ssh user has access to it. | |
# Default is in your home directory: ~/.acf-license-key | |
# Change the setting below if you need to put it somewhere else | |
# 2. install this file in /usr/local/bin or someplace in your PATH | |
# 3. make sure you have WP CLI installed | |
# 4. run acf-install-license from the root of your wordpress install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { useMinScreen } from './minScreen'; | |
const App = () => { | |
const { min } = useMinScreen(); | |
return ( | |
<> | |
{min`md` && <div>I'll show at md and up</div>} | |
{!min`lg` && <div>I'll show at up to lg</div>} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Vanilla Fitvids.js</title> | |
<style type="text/css"> | |
body { | |
margin: 0 auto; | |
max-width: 40em; | |
width: 88%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Fragment } from "@wordpress/element"; | |
import { InnerBlocks } from "@wordpress/editor"; | |
/** | |
* Changes the edit function of an ACF-block to allow InnerBlocks | |
* Should be called like this on `editor.BlockEdit` hook: | |
* ` addFilter("editor.BlockEdit", "namespace/block", editWithInnerBlocks("acf/block-name"));` | |
* | |
* @param {string} blockName the name of the block to wrap | |
* @param {object} innerBlockParams params to be passed to the InnerBlocks component (like allowedChildren) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_filter_acf_pro_license_option( $pre ) { | |
if ( ! defined( 'ACF_PRO_LICENSE' ) || empty( ACF_PRO_LICENSE ) ) { | |
return $pre; | |
} | |
$data = array( | |
'key' => ACF_PRO_LICENSE, | |
'url' => home_url(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const atimport = require("postcss-import"); | |
const { dest, src, task } = require("gulp"); | |
const postcss = require("gulp-postcss"); | |
const purgecss = require("@fullhuman/postcss-purgecss"); | |
const tailwindcss = require("tailwindcss"); | |
const TAILWIND_CONFIG = "./tailwind.config.js"; | |
const SOURCE_STYLESHEET = "./src/style.css"; | |
const DESTINATION_STYLESHEET = "./build/style.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.fSelect = function(options) { | |
if ('string' === typeof options) { | |
var settings = options; | |
} | |
else { | |
var settings = $.extend({ | |
placeholder: 'Select some options', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>title</title> | |
<style type="text/css"> | |
.nav { | |
position: fixed; | |
top: 0px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Based on http://github.com/deliciousbrains/wp-migrate-db-pro-tweaks | |
*/ | |
class ACF_WP_Migrate_DB_Pro_Tweaks { | |
function __construct() { | |
add_filter( 'wpmdb_preserved_options', array( $this, 'preserved_options' ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add WP API endpoint for form submission, then create new | |
* Gravity Forms entry and send notifications. | |
*/ | |
// rest api endpoint for forms submission | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'ahr/v1', '/forms', array( | |
'methods' => 'POST', |
NewerOlder