Skip to content

Instantly share code, notes, and snippets.

View bueltge's full-sized avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
@bueltge
bueltge / wp-hooks-filter.php
Created May 31, 2011 08:07
Instruments Hooks for a Page of WordPress. Outputs during the Shutdown Hook after add get-params: ?instrument=hooks
<?php
/*
Plugin Name: Instrument Hooks for WordPress
Plugin URI: http://bueltge.de/
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook after add get-params <code>?instrument=hooks</code>.
Version: 0.0.1
Author: Frank B&uuml;ltge
Author URI: http://bueltge.de/
*/
@bueltge
bueltge / gist:757903
Created December 28, 2010 23:27
This WordPress Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine
<?php
/*
Plugin Name: HowTo Plugin
Plugin URI:
Description: This Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine
Author: Heiko, Frank
Author URI: http://bueltge.de
Version: 0.1
License:
@bueltge
bueltge / gist:1559249
Created January 4, 2012 09:19
Custom Query Shortcode: Run a Loop inside any Post/Page
<?php
/**
* Plugin Name: Custom Query Shortcode
* Plugin URI:
* Description: Run a Loop inside any Post/Page via Shortcode <code>[loop]</code>
* Version: 0.0.1
* License: GPLv3
* Author: Frank B&uuml;ltge
* Author URI: http://bueltge.de/
*/
@bueltge
bueltge / wp-i18n-cheatsheet.md
Last active April 2, 2022 13:57
WordPress i18n Cheatsheet

WordPress i18n CheatSheet

Whenever I write plugins or themes, there is one thing that needs a little extra attention and is quite frankly hard to get right: Translatable text. This list should helps me to find the right way fast.

Props to Alex Kirk, there list it inside a quiz.

You want to output the username in a sentence.

Assume that the $username has been escaped using esc_html().

@bueltge
bueltge / RegularExpressionCheatSheet.md
Last active April 2, 2022 13:55
Regular Expression Cheat Sheet

Regular Expression Cheat Sheet - PCRE

Kudos/Source: https://github.com/niklongstone/regular-expression-cheat-sheet

Anchor Description Example Valid match Invalid
^ start of string or line ^foam foam bath foam
\A start of string in any match mode \Afoam foam bath foam
$ end of string or line finish$ finish finnish
\Z end of string, or char before last new line in any match mode finish\Z finish finnish
@bueltge
bueltge / add-rel-nofollow-checkbox.php
Created February 14, 2017 12:41 — forked from danielbachhuber/add-rel-nofollow-checkbox.php
Add a 'Add rel="nofollow" to link' checkbox to the WordPress link editor
<?php
/**
* Add a 'Add rel="nofollow" to link' checkbox to the WordPress link editor
*
* @see https://danielbachhuber.com/tip/rel-nofollow-link-modal/
*/
add_action( 'after_wp_tiny_mce', function(){
?>
<script>
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Gutenberg Add Formatting
* Description: Add formatting button in Gutenberg.
* Plugin URI:
* Version: 0.0.1
* Author:
* Author URI:
* Licence: MIT
* Text Domain:
@bueltge
bueltge / question.md
Created March 19, 2020 07:57
Rules to use open source solutions?

If I create new solutions, libraries then is often my task to search for existing solutions to use them or use them as library to create faster and more solid the goal. The current status is more feeling, a mind set on my side to decide is this repository useful and still active in maintenance. So I look at the project is it a 'one man show' or a lot of committers, an organization. This entirely depends on my priorities and field. The more experimental or niche work my do. Different languages may also exhibit different technical traits here which makes this more or less of a concern. In the end I will have to decide for myself, but a list of helping points is more transparent and supporting my decision.

So I want to create clues and indications (not really rules) to get an easier decision to use or not use this library in my project.

Maybe you had also thought about or you have the same problem.

How you decide about the dependencies in your project?

@bueltge
bueltge / stick-unstick-admin-bar.php
Created July 31, 2012 08:25
WordPress Plugin, that add a stick/unstick post link to the admin bar of WordPress.
<?php
/**
* Plugin Name: Stick/Unstick post via Admin bar
* Plugin URI: http://wordpress.stackexchange.com/q/58818/6035
* Description: Add a stick/unstick post link to the admin bar of WordPress.
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
@bueltge
bueltge / commentmeta-single.php
Created May 3, 2011 11:35
WordPress Example Plugin: Comment meta data test
<?php
/*
Plugin Name: Comment meta data test
Version: 1.0
Plugin URI: http://wpengineer.com
Description: Comment meta data test
Author: Latz
Author URI: http://wpengineer.com
*/