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
# Directives to send expires headers and turn off 404 error logging. | |
location ~* .(js|css|png|jpg|jpeg|gif|ico|mp3|mov|tif|tiff|swf|txt|html)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 8.8.8.8; | |
# replace www.livesite.com with the production site 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
<?php | |
/** | |
* Include all non-core taxonomies in the sync request, limiting by publicly queryable. | |
* | |
* @param array The list of existing taxonomies. | |
* @return array The new array list. | |
*/ | |
function sync_non_core_taxonomies( $taxonomies ) { | |
$taxes = get_taxonomies(); | |
foreach ( $taxes as $taxonomy ) { |
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 | |
/** | |
* Copyright 2019 Inpsyde GmbH | |
* | |
* @license MIT https://opensource.org/licenses/MIT | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
#!/usr/bin/env bash | |
# Shortcut for WP Snapshots usage in wp-local-docker | |
# | |
# @link: https://github.com/10up/wp-local-docker#wp-snapshots | |
function snap() { | |
if [ -f "$PWD/bin/wpsnapshots.sh" ]; then | |
sh ./bin/wpsnapshots.sh "$@" | |
fi | |
} |
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 | |
/** | |
* AMP Image Lightbox Links plugin file. | |
* | |
* @package AMP_Image_Lightbox_Links | |
* @author Felix Arntz, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2019 Google Inc. | |
* | |
* @wordpress-plugin |
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 | |
/** | |
* Make an internal REST request | |
* | |
* @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server). | |
* @param $request_or_method WP_REST_Request|string A WP_REST_Request object or a request method | |
* @param $path (optional) if the path is not specific in the rest request, specify it here | |
* @param $data (optional) option data for the request. | |
* @return WP_Error|mixed |
This is an easy way to integrate a basic Instagram feed into a WordPress site.
First, register with Instagram's developer program, then register a client. Set the client ID they provide you in line 4.
Second, get your Instagram user ID by running this in your terminal:
curl -X GET https://api.instagram.com/v1/users/search\?q\=USERNAME\&client_id\=CLIENT_ID
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
/** | |
* WordPress dependencies | |
*/ | |
const { __ } = wp.i18n; | |
const { Fragment } = wp.element; | |
const { toggleFormat } = wp.richText; | |
const { RichTextToolbarButton, RichTextShortcut } = wp.editor; | |
const { registerFormatType } = wp.richText; | |
/** |
OlderNewer