Skip to content

Instantly share code, notes, and snippets.

@brasofilo
brasofilo / press-this-thickbox.php
Last active December 10, 2015 20:48
Dealing with PressThis inside an administrative thickbox
<?php
/**
Auxiliary menu and page with a button to open the thickbox
*/
add_action('admin_menu', 'add_auxiliary_menu');
function add_auxiliary_menu()
{
add_menu_page(
'TB',
@brasofilo
brasofilo / get-plugin-info.php
Last active December 15, 2015 01:19
Buscar informarción de plugins
<?php
/**
* Imprime información del plugin en el pié de página del sitio
* Ejemplo bruto de como se hace
* Mover la llamada a la función informacion_del_plugin() donde sea apropriado
* /
add_action( 'wp_footer', 'imprimir_info_de_plugin' );
function imprimir_info_de_plugin()
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
<?php
/**
* Plugin Name: T5 WP Load Order
* Description: Hooks into every action and creates a list of available variables, constants, functions, classes and files.
* Plugin URI:
* Version: 2012.11.05
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
* License URI: http://opensource.org/licenses/MIT
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Plugin Class Demo
* Description: How I am using the base class in plugins.
* Plugin URI:
* Version: 2012.09.29
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: GPL
* Text Domain: plugin_unique_name
<?php
/**
* Plugin Name: T5 Head Meta
* Description: Meta data for head element
* Plugin URI:
* Version: 2013.04.08
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
* License URI: http://opensource.org/licenses/MIT
@brasofilo
brasofilo / gist:5605328
Created May 18, 2013 18:15
GlotPress - plugin to remove Google Translate links
<?php
class Glot_No_Google extends GP_Plugin {
function __construct() {
parent::__construct();
$this->add_action( 'gp_head' );
}
function gp_head() {
echo '<style type="text/css">.gtranslate {display:none}</style>';
}
}
/*
PLAYER
*/
.site-title {display:none;}
.audioplayer
{
height: 2.5em; /* 40 */
color: #fff;
text-shadow: 1px 1px 0 #000;
border: 1px solid #222;
@brasofilo
brasofilo / glot-no-google.php
Last active December 17, 2015 15:29
GlotPress plugin to hide Google Translate, which doesn't work anymore with GP.
<?php
/**
* Hide Google Translate elements from GlotPress interface
* Put this file in the folder: /glotpress/plugins/
*/
class Glot_No_Google extends GP_Plugin
{
private $pagenow = false;