Skip to content

Instantly share code, notes, and snippets.

View shirayukikitsune's full-sized avatar

Bruno Ferreira shirayukikitsune

View GitHub Profile
@shirayukikitsune
shirayukikitsune / Autohook.php
Last active February 28, 2018 18:43
A PHP abstract class that will automatically register all methods as a wordpress action or filter
<?php
/**
* When a class extends this, this will use PHP reflection to automatically register actions and filters
* Note that this class cannot be instantiated, it is marked as abstract
*
* In order to add a method as a filter, simply name it as `filter_FILTERNAME`. For example: `filter_body_class` will add that method as a hook for the filter 'body class'
* The same applies to actions, but the naming changes to `action_ACTIONNAME`. For example: `action_widgets_init`
*/
abstract class Autohook {
public function __construct() {
#!/bin/bash
# Força saída caso ocorra um erro
set -e
echo $(date) - Starting update process
# Muda para o diretório de execução
cd ~/kingdomage-build/kingdom-age-site