Skip to content

Instantly share code, notes, and snippets.

@franz-josef-kaiser
franz-josef-kaiser / curl_dump.php
Last active May 22, 2022 14:57
Debug and dump a WordPress cURL Request and it's response during a WP HTTP API call.
<?php
/**
* Plugin Name: Dump WP HTTP API cURL Request & Response
* Author: Franz Josef Kaiser
*/
add_action( 'plugins_loaded', array( 'WPSE81791_cURL', 'init' ) );
class WPSE81791_cURL
{
protected static $instance;
@thefuxia
thefuxia / t5-table-size-dashboard-widget.php
Last active December 10, 2015 17:58
T5 Table size dashboard widget Print a list of table sizes into your dashboard.
<?php
/**
* Plugin Name: T5 Table size dashboard widget
* Description: Print a list of table sizes into your dashboard.
* Plugin URI:
* Version: 2013.01.07
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
* License URI: http://opensource.org/licenses/MIT
@franz-josef-kaiser
franz-josef-kaiser / dashboard_widget_recently_edited_files.php
Last active December 10, 2015 01:48
Show the last X recently edited files in a dashboard widget
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (#64910) (Dashboard Widget) Last edited files
* Description: Lists the last edited files in a dashboard widget
* Author: Franz Josef Kaiser <wecodemore@gmail.com>
* Author URL: https://plus.google.com/107110219316412982437
* License: MIT
*/
@thefuxia
thefuxia / t5-custom-logout-url.php
Created December 14, 2012 20:49
T5 Custom Log-out URL Create a custom log-out URL in WordPress.
<?php
/**
* Plugin Name: T5 Custom Log-out URL
* Description: Create a custom log-out URL.
* Plugin URI: http://wordpress.stackexchange.com/questions/76161/masking-logout-url
* Version: 2012.12.14
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
* License URI: http://opensource.org/licenses/MIT
@kloon
kloon / gist:4228021
Created December 6, 2012 20:25
WooCommerce variations custom field
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'variable_fields_process', 10, 1 );
function variable_fields( $loop, $variation_data ) {
?>
<tr>
@franz-josef-kaiser
franz-josef-kaiser / paranoia-config.php
Last active July 29, 2022 10:01
WordPress debug - Error Reporting Level: Paranoia
<?php
define( 'DS', DIRECTORY_SEPARATOR );
# ==================================
# PHP errors & log
error_reporting(
E_ALL | E_STRICT | E_CORE_ERROR | E_CORE_WARNING
| E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE
| E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR
);
# OR: shorter and all together
@thefuxia
thefuxia / t5-attachment-extras.php
Created September 6, 2012 13:15
T5 Attachment Extras
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Attachment Extras
* Description: Adds attachment ID and link to parent post to the attachment screen.
* Plugin URI: http://toscho.de/?p=2260
* Version: 2012.09.06
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
@tott
tott / gist:3496266
Created August 28, 2012 08:42
enforce http
<?php
add_action( 'plugins_loaded', 'bypass_wp_login_for_pw_protected_posts' );
function bypass_wp_login_for_pw_protected_posts() {
// this functionality is a fork of http://core.trac.wordpress.org/browser/trunk/wp-login.php#L385
// keep this in sync with Core
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login';
if ( 'postpass' <> $action )
return;
@PeteMall
PeteMall / plugin-last-updated.php
Created June 19, 2012 20:00
Display the last updated date for all plugins from the WordPress.org plugins repo.
<?php
/*
Plugin Name: Plugin Last Updated
Version: 1.0
License: GPL
Author: Pete Mall, Range
Author URI: http://petemall.com/
Description: Display the last updated date for all plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress.org plugins repo</a>.
*/
@da1nonly
da1nonly / gist:2057532
Created March 17, 2012 10:55
wordpress meta box urls
<?php
add_action('admin_init', 'add_meta_boxes', 1);
function add_meta_boxes() {
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high');
}
function repeatable_meta_box_display() {
global $post;