Skip to content

Instantly share code, notes, and snippets.

💻

Theodoro Caliari theodorocaliari

💻
  • Brazil
Block or report user

Report or block theodorocaliari

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:bcb6d8fb2362860f0d88a70b1e39d0df
<?php
// Filter the gallery shortcode defaults
// http://wordpress.stackexchange.com/questions/4343/how-to-customise-the-output-of-the-wp-image-gallery-shortcode-from-a-plugin
add_filter( 'post_gallery', 'my_post_gallery', 10, 2 );
function my_post_gallery( $output, $attr) {
global $post, $wp_locale;
static $instance = 0;
$instance++;
@theodorocaliari
theodorocaliari / gist:8b743f95f510bd007d42719523a4297f
Created Sep 23, 2016
Alterando Linguagem do Sistema no Debian (Linux)
View gist:8b743f95f510bd007d42719523a4297f
https://wiki.debian.org/ChangeLanguage
@theodorocaliari
theodorocaliari / wysiwyg-meta-box.php
Created Nov 3, 2015 — forked from bainternet/wysiwyg-meta-box.php
How to add a Wordpress WYSIWYG editor to a meta box.
View wysiwyg-meta-box.php
<?php
define('WYSIWYG_META_BOX_ID', 'my-editor');
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different
define('WYSIWYG_META_KEY', 'extra-content');
add_action('admin_init', 'wysiwyg_register_meta_box');
function wysiwyg_register_meta_box(){
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post');
}
View quantize.js
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
View robots.txt
# All Agents
User-agent: *
Disallow: /blogs.dir
Disallow: /cgi-bin
Disallow: /wp-content/cache
Disallow: /wp-content/languages
Disallow: /wp-content/mu-plugins
Disallow: /wp-content/plugins
Disallow: /wp-content/upgrade
Disallow: /wp-admin
View functions.php
<?php
/**
* Include the following code in your theme functions.php;
* but first you need to include PHP Console library using one of the methods
* described in PHP Console documentation.
*/
$phpConsole = PhpConsole\Handler::getInstance()->isStarted();
// This check makes sure PHP Console is instantiated only once.
if ( $phpConsole == false ) {
View example.php
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
@theodorocaliari
theodorocaliari / page-template.php
Created Dec 8, 2014
Verify if the_content() is empty
View page-template.php
<?php
//https://wordpress.org/support/topic/how-can-i-avoid-displaying-empty-the_content
if($post->post_content != ""){
the_content();
}
View ts-anwpuspr.php
<?php
// Add Password, Repeat Password and Are You Human fields to WordPress registration form
// http://wp.me/p1Ehkq-gn
add_action( 'register_form', 'ts_show_extra_register_fields' );
function ts_show_extra_register_fields(){
?>
<p>
<label for="password">Password<br/>
<input id="password" class="input" type="password" tabindex="30" size="25" value="" name="password" />
You can’t perform that action at this time.