Skip to content

Instantly share code, notes, and snippets.

@thefuxia
thefuxia / product-editor-column.php
Last active April 7, 2020 20:14
Plugin Product Editor Column
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Product Editor Column
* Description: Adds a column to the products table backend with the name of the last editor. Requires at least PHP 5.4.
* Author: Fuxia
* Version: 2014.08.09
* Licence: MIT
* Plugin URI: http://wordpress.stackexchange.com/a/157258/73
*/
namespace WPSE;
<?php
/**
* Remove callbacks for problematic hooks.
*
* Many plugins and themes do not check for a switched site context, they will
* save $_POST data to the wrong site. This class tries to remove all those
* callbacks.
*
* @version 2014.07.23
* @author Inpsyde GmbH, toscho
@thefuxia
thefuxia / mlp_duplicated_blog.php
Created July 2, 2014 05:27
Multilingual Press: mlp_duplicated_blog
<?php
// In inc/pro/controllers/Mlp_Duplicate_Blogs.php,
// at the end of Mlp_Duplicate_Blogs::wpmu_new_blog()
$context = array (
'source_blog_id' => $source_blog_id,
'new_blog_id' => $blog_id
);
/**
@thefuxia
thefuxia / mlp_navigation_with_login.php
Created April 29, 2014 21:02
function mlp_navigation_with_login()
<?php
// copy from here
/**
* Create a navigation like: DE | EN | RU | Log in
*
* @return string
*/
function mlp_navigation_with_login()
@thefuxia
thefuxia / Mlp_Redirect.php
Created April 28, 2014 00:17
Class Mlp_Redirect
<?php
/**
* Class Mlp_Redirect
*
* @version 2014.04.28
* @author Inpsyde GmbH, toscho
* @license GPL
*/
class Mlp_Redirect {
@thefuxia
thefuxia / wp-breadcrumb.php
Last active August 29, 2015 13:59
Basic concept for a flexible OOP breadcrumb setup
<?php
interface Wp_Breadcrumb_Strings_Interface {
public function get_text( $item );
}
class Wp_Breadcrumb_Strings implements Wp_Breadcrumb_Strings_Interface {
public function get_text( $item ) {}
}
@thefuxia
thefuxia / snippets.txt
Created February 1, 2014 18:41
Moderation snippets for WordPress Stack Exchange
## Comments added to deleted comments and answers, visible for the post author only.
Sorry, but this is not [an answer](http://wordpress.stackexchange.com/questions/how-to-answer).
[An answer should be more than just a link to an external site](http://wordpress.stackexchange.com/help/deleted-answers). Please add a solution.
[Ask a new question.](http://wordpress.stackexchange.com/questions/ask) Please don’t misuse the answer field for questions. Thanks.
[You must disclose your affiliation in your answers.](http://wordpress.stackexchange.com/help/behavior)
@thefuxia
thefuxia / t5-ajax-editor.php
Created January 20, 2014 05:05
Fetch TinyMCE per AJAX. Media upload doesn’t work yet.
<?php
/**
* Plugin Name: T5 AJAX Editor
*/
namespace T5AjaxEditor;
class Controller implements Event_Handler
{
@thefuxia
thefuxia / t5-plugins-last-mod.php
Created January 9, 2014 18:36
Show last modified date for plugins in plugin list.
<?php
/**
* Plugin Name: T5 Plugin Modification Info
* Description: Show last modified date for plugins in plugin list.
*/
add_filter( 'plugin_row_meta', 't5_plugins_last_mod', 100, 2 );
/**
* Add en entry to the plugin description.
*
@thefuxia
thefuxia / module-manager.php
Last active January 1, 2016 13:39
interface Mlp_Module_Manager
interface Module_Manager {
/**
* Register a module.
*
* @param array $module Required: slug, description and display_name
* @return bool TRUE if the module is active, FALSE if it isn't.
*/
public function register( Array $module );