Skip to content

Instantly share code, notes, and snippets.

@covertnine
covertnine / c9-githooks-gist.txt
Created September 14, 2020 18:52
Setting up GitHooks for WordPress related repos
This is a brief summary of our private wiki for setting up Githooks on our servers for managing multiple WordPress sites with custom themes and plugins.
Setup
This process is a little bit involved, but hopefully we can simplify it all via a few scripts on site creation. Basically, we set up a bare repo on the remote (the server) for each plugin or theme, then create a git post-receive hook that triggers on push to that repo, which runs a script to update all the websites on the server that use that plugin or theme.
For this process, I'll walk through the necessary steps to deploy the c9-admin plugin to sites on our.serverhost.net
1) Create a bare repo on the server
Bare repositories live in /srv/git. You can either create a bare repo on init or on clone. In this case, we will create a bare repo call c9-admin.git by running:
@covertnine
covertnine / client-setup.php
Last active January 5, 2021 19:01
client-setup.php without commas for C9-Starter block patterns for older versions of php
<?php
/**
* C9 Client Setup
*
* @package c9-starter
*/
add_action('after_setup_theme', 'c9_client_setup');
if (!function_exists('c9_client_setup')) {