Skip to content

Instantly share code, notes, and snippets.

View anthonybudd's full-sized avatar

Anthony C. Budd anthonybudd

View GitHub Profile
<h3>You have a new contact from enquirey!</h3><br>
<p>
<strong>Time:</strong><?= $time ?>
</p>
<p>
<strong>Name:</strong><?= $name ?>
</p>
<?php
require 'ContactFormAction.php';
<?php
/*
Template Name: Contact Page
*/
?>
<form action="<?= ContactFormAction::url() ?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="from_action" value="<?= ContactFormAction::getActionName() ?>">
<input type="text" name="full_name"><br />
<h1>Hello {{name}},</h1>
<p>I have found a great class from a developer in {{location}}.</p>
<a href="{{link}}">Check it out on GitHub</a>
<?php
$email = WP_Mail::init()
->to('[email protected]')
->subject('WP_Mail is great!')
->attach(ABSPATH . 'wp-content/uploads/2018/6/image.png')
->template(get_template_directory() .'/emails/demo.php', [
'name' => 'Anthony Budd',
'location' => 'London',
'skills' => [
<?php
// functions.php
function forceLogin(){
if(!is_user_logged_in()){
$redirect = TRUE;
foreach(['wp-admin', 'wp-login'] as $url) {
if(strpos($_SERVER['REQUEST_URI'], $url) !== FALSE){
$redirect = FALSE;
<table id="bodyTable" border="0" width="100%" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td id="bodyCell" style="padding-bottom: 40px;" align="center" valign="top">
<!-- BEGIN TEMPLATE // -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="top">
<!-- BEGIN PREHEADER // -->
<center></center>&nbsp;
<table id="bodyTable" border="0" width="100%" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td id="bodyCell" style="padding-bottom: 40px;" align="center" valign="top"><!-- BEGIN TEMPLATE // -->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="top"><!-- BEGIN PREHEADER // -->
<!-- // END PREHEADER --></td>
<?php
register_post_type( 'book', array(
'public' => true,
'label' => __( 'Books', 'textdomain' ),
));