Skip to content

Instantly share code, notes, and snippets.

View richerimage's full-sized avatar

Richard Barratt richerimage

View GitHub Profile
@chrismccoy
chrismccoy / restapi.txt
Last active March 30, 2024 08:17
WordPress REST API Resources
Disable REST Api without Plugins
https://rudrastyh.com/wordpress/disable-rest-api.html
Add featured image & alt text to WP REST API
https://allisontarr.com/2021/10/13/add-featured-image-alt-text-to-wp-rest-api/
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js
/*
** http://wpvkp.com/add-social-media-sharing-buttons-to-wordpress-without-plugin/
** @blogvkp
** http://wpvkp.com/
*/
// Function to handle the thumbnail request for pinterest
function gpt_src($img)
@mathetos
mathetos / plugin.php
Last active April 13, 2023 16:48
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/
@horne3754sg
horne3754sg / example-thesis-box-with-cpt
Last active August 29, 2015 14:06
An example Thesis 2 box demonstrating how to register a Custom Post Type (CPT) within boxes.
<?php
/*
Name: Example CPT registration in a Thesis 2 Box
Author: Matthew Horne - Zerogravityskins.com
Description: enter your description here.
Version: 1.0
Class: my_custom_class
*/
class my_custom_class extends thesis_box {
@richerimage
richerimage / TinyMCE Styles
Created September 8, 2014 15:46
Add styles to TinyMCE in DNA Skin
class dna_custom_class extends thesisdna {
public function __construct() {
add_filter ('dna_tinymce', array($this, 'add_my_tinycss'));
}
public function add_my_tinycss($dna_admin_css) {
@seanuk
seanuk / Standard Terms & Conditions.md
Last active April 16, 2023 02:24
My standard terms & conditions for web projects. Together with a signed project proposal it forms a working agreement. Includes bits borrowed from https://gist.github.com/malarkey/4031110 & https://gist.github.com/maban/6098135

Standard Terms & Conditions

The following terms and conditions, together with a signed project proposal, form an agreement that is intended to protect both parties, and is no way meant to trick or deceive you. We have tried to keep the wording as plain as possible, but if anything is unclear we will be more than happy to clarify it with you.

In short, [CLIENT COMPANY] (referred to herein as “you”) is engaging SJD Digital (referred to herein as “us” & “we”), to undertake the work as specified in the attached proposal, and under the requirements of these terms and conditions.

Deadlines

We will do our best to meet all agreed deadlines. You agree to review our work and provide feedback and approval in a timely manner. You accept that delays in supplying required information or materials may result in longer delays to the delivery of the finished work.

@davidsneal
davidsneal / html-share-buttons.html
Last active December 12, 2023 13:18
HTML Share Buttons
<!-- I got these buttons from simplesharebuttons.com -->
<div id="share-buttons">
<!-- Buffer -->
<a href="https://bufferapp.com/add?url=https://simplesharebuttons.com&amp;text=Simple Share Buttons" target="_blank">
<img src="https://simplesharebuttons.com/images/somacro/buffer.png" alt="Buffer" />
</a>
<!-- Digg -->
<a href="http://www.digg.com/submit?url=https://simplesharebuttons.com" target="_blank">
@mikemanger
mikemanger / typekit.editor.php
Last active March 8, 2020 00:39 — forked from tomjn/typekit.editor.php
Add a TypeKit font to the TinyMCE editor in WordPress.
add_filter( 'mce_external_plugins', 'my_theme_mce_external_plugins' );
function my_theme_mce_external_plugins( $plugin_array ) {
$plugin_array['typekit'] = get_template_directory_uri() . '/typekit.tinymce.js';
return $plugin_array;
}
add_action('media_buttons','add_sc_select',11);
function add_sc_select(){
global $shortcode_tags;
/* ------------------------------------- */
/* enter names of shortcode to exclude bellow */
/* ------------------------------------- */
$exclude = array("wp_caption", "embed");
echo '&nbsp;<select id="sc_select"><option>Shortcode</option>';
foreach ($shortcode_tags as $key => $val){
if(!in_array($key,$exclude)){
<?php
add_filter( 'default_content', 'add_default_content' );
function add_default_content( $content ) {
global $post_type;
switch ( $post_type ) {
case 'post':
$content = "<p>This will be the first paragraph of all new BLOGPOSTS. I am adding a default paragraph. You can add any HTML code or text.</p>";
break;
case 'page':
$content = "<p>This will be the first paragraph of all new PAGES. I am adding a default paragraph. You can add any HTML code or text.</p>";