Zach Silveira was kind enough to create a video tutorial:
https://www.youtube.com/watch?v=apZwd0FqQu4&feature=youtu.be
Here are my notes as I followed along...
- Install Docker for Mac.
<?php | |
/** | |
* The WordPress Meme Shortcode admin page. | |
* | |
* @author Carl Alexander | |
*/ | |
class WPMemeShortcode_AdminPage | |
{ | |
/** |
<?php // only copy this line if needed | |
/** | |
* Renders a notice and prevents checkout if the cart | |
* only contains products in a specific category | |
*/ | |
function sv_wc_prevent_checkout_for_category() { | |
// set the slug of the category for which we disallow checkout | |
$category = 'clothing'; |
<?php | |
function mytheme_block_templates( $args, $post_type ) { | |
// Only add template to 'post' post type | |
// Change for your post type: eg 'page', 'event', 'product' | |
if ( 'post' == $post_type ) { | |
// Optionally lock templates from further changes | |
// Change to 'insert' to allow adding other blocks, but lock defined blocks |
Zach Silveira was kind enough to create a video tutorial:
https://www.youtube.com/watch?v=apZwd0FqQu4&feature=youtu.be
Here are my notes as I followed along...
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
<?php | |
/** | |
* Custom Loop Add to Cart. | |
* | |
* Template with quantity and ajax. | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. | |
global $product; |
add_action( 'graphql_register_types', 'register_dog_type' ); | |
function register_dog_type() { | |
register_graphql_object_type( 'Dog', [ | |
'description' => __( "Man's best friend", 'your-textdomain' ), | |
'fields' => [ | |
'name' => [ | |
'type' => 'String', | |
'description' => __( 'The name of the dog', 'your-textdomain' ), | |
], |
<?php | |
/** | |
* Plugin Name: Ignore WP5 Updates | |
* Plugin URI: https://gist.github.com/nylen/44adecb537d65bd4c64be8007cd1523b | |
* Description: Keep a site on WP 4.9.x with security updates | |
* Version: 1.1.0 | |
* Author: James Nylen | |
* License: GPLv2 - https://www.gnu.org/licenses/gpl-2.0.html | |
*/ |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} !/wp-admin | |
RewriteCond %{REQUEST_URI} !/wp-includes | |
RewriteCond %{REQUEST_URI} !/wp-login\.php$ | |
RewriteCond %{REQUEST_URI} !/wp-content | |
RewriteCond %{REQUEST_URI} !/feed |