Skip to content

Instantly share code, notes, and snippets.

@jotazzu
jotazzu / edit-screen.php
Last active January 26, 2024 20:20
Makes WordPress plugin "Tabify Edit Screen" running again with PHP 8.1 and WP 6.4.2. Three files tabify-edit-screen.php, inc/edit-screen.php and inc/settings-base.php. Replace the original files in plugin folder .../wp-content/plugins/tabify-edit-screen/. Related https://wordpress.org/support/topic/patch-for-php-8-1-and-wp-6-4-2/
<?php
/**
* //jt 26.05.21: WP core function 'remove_meta_box()' sets $metabox = false. Adjusted for compatibility with PHP 7.4.
*/
include 'tabs.php';
class Tabify_Edit_Screen_Edit_Screen {
private $tab_location = 'default';
private $all_metaboxes = array();
@jotazzu
jotazzu / linkable-title-html-and-php-widget.php
Last active December 6, 2023 20:39
This makes the unmaintained 10 years old WordPress plugin "Linkable Title Html and Php Widget" running again with PHP 8.0 and WP version 6.4.1. Replaces outdated constructor method and some other adjustments (see comments in code). Simply replace the file in folder .../wp-content/plugins/linkable-title-html-and-php-widget/ with the same name.
<?php
/*
Plugin Name: Linkable Title Html and Php Widget by PepLamb
Plugin URI: http://peplamb.com/linkable-title-html-and-php-widget/
Description: JT 14.10.2019: Modified to implement new object constructor method __construct() | JT 26.05.2020: Modified for some PHP notices || <a href="http://peplamb.com/linkable-title-html-and-php-widget/" target="_blank">Linkable Title Html and Php Widget</a> by <a href="http://peplamb.com/linkable-title-html-and-php-widget/" target="_blank">PepLamb</a>! Using this plugin you may have Text, HTML, Javascript, Flash and/or Php as content in this widget with linkable widget titles, so this is a plus compared to the default wordpress' text widget. This plugin is a personal open source project. Started in 2009, I have put considerable amount of hours adding, refining, tuning, fixing, maintaining the plugin with the goal to make it useful and add to Wordpress community. I need your help to achieve this. <a href='https://pledgie.com/campaigns/23211' target="_blank">Donate</a>
Ver
@jotazzu
jotazzu / class-redirection-redirects.php
Last active January 31, 2024 10:53
This class allows to use WordPress plugin Redirection to add/remove redirects programmatically. It should be included in a custom plugin as it only works in the WP backend.
<?php
/**
* Creates and removes redirects for a post slug
*
* Creates and removes entries in the redirect list of plugin 'Redirection'.
*
* @link https://gist.github.com/jotazzu
* @since 1.0.1
*
@jotazzu
jotazzu / edit-screen.php
Last active December 19, 2019 23:59
Replaces deprecated calls to create_function() in WordPress plugin Tabify Edit Screen with anonymous function definitions. See https://wordpress.org/support/topic/another-patch-create_function-is-deprecated-since-php-7-2/
<?php
/**
* //JT 13.12.19: create_function() is deprecated.
*/
include 'tabs.php';
class Tabify_Edit_Screen_Edit_Screen {
@jotazzu
jotazzu / boot-loader.php
Created May 12, 2016 17:54
Modifies WordPress plugin 'WP System Health' (v1.4.0) due to problems with 'Strict Standards'. These are two files wp-system-health.php and boot-loader.php. For further infos see https://wordpress.org/support/topic/redefining-already-defined-constructor-for-class-wpsh_plugin#post-5930194
<?php
//jt: with fix from Midlife Riding (https://wordpress.org/support/topic/redefining-already-defined-constructor-for-class-wpsh_plugin#post-5930194
class wpsh_boot_loader {
function __construct() {
$this->pure_init = !function_exists('add_action');
$this->memory_limit = (int) $this->convert_ini_bytes(@ini_get('memory_limit'));
//if no limit is available set it to 1GB to be sure at divisions ;-)
if($this->memory_limit == 0) $this->memory_limit = 1024*1024*1024;
$this->mem_usage_possible = function_exists('memory_get_usage');
@jotazzu
jotazzu / ad-integration.php
Last active January 15, 2016 09:30
Extends WordPress plugin 'Active Directory Integration' (v1.1.5) with a single sign-on (SSO) feature. These are three files ad-integration.php, admin.php and a fragment to add to functions.php. For further infos see https://wordpress.org/support/topic/feature-automatic-login-single-sign-on-added
<?php
/*
Plugin Name: Active Directory Integration (modified for SSO)
Version: 1.1.5.1.jt-1
Plugin URI: http://www.steindorff.de/wp-ad-integration
Description: Allows WordPress to authenticate, authorize, create and update users through Active Directory
Author: Christoph Steindorff
Author URI: http://www.steindorff.de/
@jotazzu
jotazzu / dynamic-image-resizer.php
Last active October 10, 2016 19:05
Modification of WordPress Plugin "Dynamic Image Resizer". Additionally allows to dynamically create the meta data for intermediate image sizes for already uploaded images.
<?php /*
Plugin Name: Dynamic Image Resizer
Plugin URI: http://ottopress.com
Author: Otto42 / Modified by JochenT
Author URI: http://ottodestruct.com
Version: 1.0.0.1.jt-3 (11.10.2013)
Description: Change the WordPress image uploader system to do image resizing on the fly.
*/
/*