Skip to content

Instantly share code, notes, and snippets.

Txema León txemaleon

Block or report user

Report or block txemaleon

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
@txemaleon
txemaleon / functions.php
Last active Jun 25, 2018
Allow HTML Tags in WordPress Excerpts
View functions.php
<?php
/**
* Allow HTML Tags in Wordpress Excerpt
*
* @link http://wordpress.stackexchange.com/questions/141125/allow-html-in-excerpt/141136
*/
if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) :
function wpse_custom_wp_trim_excerpt( $wpse_excerpt ) {
@txemaleon
txemaleon / class.className.php
Created Jun 9, 2016
A Basic Class Template for Wordpress Plugins
View class.className.php
<?php
class className {
function __construct() {}
}
function className() {
new className;
@txemaleon
txemaleon / pre.php
Created Apr 24, 2016
pre() es una pequeña función que muestra el contenido de una variable
View pre.php
<?php
/**
* Muestra el contenido de una variable
* @param mixed $texto Variable a Mostrar
* @return n/a
*/
function pre( $texto ) {
echo '<pre>';
print_r( $texto );
echo '</pre>';
View pre.sublime-snippet
<snippet>
<content><![CDATA[
pre( \$${1:var} );${2}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pr</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
@txemaleon
txemaleon / woocommerce_myorders_sc.php
Created Mar 23, 2016
Shortcode to display "My Orders" in a custom page, instead of in the "My Account" Page in WooCommerce
View woocommerce_myorders_sc.php
function txl_my_orders_sc( $atts ) {
$atts = shortcode_atts( array(
'order_count' => -1,
), $atts ));
ob_start();
wc_get_template( 'myaccount/my-orders.php', array(
'order_count' => $atts[ 'order_count' ],
You can’t perform that action at this time.