Skip to content

Instantly share code, notes, and snippets.

Avatar

Johannes Kinast goaround

View GitHub Profile
@goaround
goaround / reusable-block-revisions.php
Created Apr 6, 2021
Adds revision support to the wp_block post type. Can be deleted after this issue https://github.com/WordPress/gutenberg/issues/19149 is closed & merged into WordPress Core
View reusable-block-revisions.php
<?php
/*
Plugin Name: Reusable Block Revisions
Plugin URI: http://travel-dealz.de/
Description: Adds revision support to the wp_block post type. Can be deleted after this issue https://github.com/WordPress/gutenberg/issues/19149 is closed & merged into WordPress Core
Version: 1.0.0
Author: Johannes Kinast
Author URI: https://go-around.de
Min WP Version: 5.0
Max WP Version: 5.7
@goaround
goaround / change-guid-on-update.php
Created Jul 9, 2020
WordPress Snippet for changing the RSS Feed GUID after a significant post update
View change-guid-on-update.php
<?php
/**
* Plugin Name: Change RSS Feed GUID on update
* Plugin URI:
* Description: Change the RSS Feed GUID after a significant post update
* Author: Johannes Kinast <johannes@travel-dealz.de>
* Author URI: https://go-around.de
* Version: 1.0.0
*/
namespace Feed_Guid;
@goaround
goaround / taxonomy-wp-rest-search.php
Created Jun 12, 2020
WordPress Plugin: Taxonomy WP REST Search for the WordPress Block Editor (Gutenberg)
View taxonomy-wp-rest-search.php
<?php
/**
* Plugin Name: Taxonomy WP REST Search
* Plugin URI:
* Description: Taxonomy WP REST Search for the WordPress Block Editor (Gutenberg)
* Author: Johannes Kinast <johannes@travel-dealz.de>
* Author URI: https://go-around.de
* Version: 1.0.0
*/
namespace Taxonomy_WP_REST_Search;
View README.md

Add to Buffer (in iframe)

Use this handy javascript snippet to add an "Add to Buffer" bookmark. Then you can add anything to your Buffer, anytime, all without leaving the page.

How it works

First, copy the following into your clipboard (it's the attached Javascript, but formatted as a bookmarklet):

javascript:(function () { var enc = encodeURIComponent; function bufferUrl(url, title) { baseUrl = '//bufferapp.com/add?'; return baseUrl + 'url=' + enc(url) + '&text=' + enc(title); } function bufferFrame() { var iframe = document.createElement('iframe'); iframe.setAttribute('style', 'width: 900px; height: 500px; position: fixed; top: 50%; left: 50%; margin-left: -450px; margin-top: -250px; background: #fff;%20border:%20solid%201px%20#000;%20z-index:%201000;');%20iframe.setAttribute('frameborder',%20'0');%20url%20=%20bufferUrl(document.location.href,%20document.querySelector('h1').innerText);%20iframe.src%20=%20url;%20return%20iframe;%20}%20function%20closeBtn(iframe)%20{%20var%20btn%20=%20document.c