Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂
Happy and peace when coding

Tran Ngoc Tuan Anh rilwis

🙂
Happy and peace when coding
View GitHub Profile
@jlengstorf
jlengstorf / README.md
Last active Sep 10, 2018
Removes the junk that wpautop adds to shortcodes in WordPress.
View README.md

Remove Crappy Markup from WordPress Shortcodes

When using shortcodes in WordPress like so:

[shortcode]

Content goes here...

[/shortcode]
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active Sep 18, 2020
Using Git with Subversion Mirroring for WordPress Plugin Development
View wordpress-plugin-svn-to-git.md
@joncave
joncave / endpoints.php
Created Jun 7, 2012
WP_Rewrite endpoints demo
View endpoints.php
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {
View class-app-view.php
/**
* Helper class for controlling all aspects of a view.
*
* Supported methods (automatically hooked):
* - init() - for registering post types, taxonomies, rewrite rules etc.
* - parse_query() - for correcting query flags
* - pre_get_posts() - for altering the query, without affecting the query flags
* - posts_search(), posts_clauses(), posts_request() - for direct SQL manipulation
* - the_posts() - for various other manipulations
* - template_redirect() - for enqueuing scripts etc.
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012
WordPress Fragment Caching convenience wrapper
View gist:2653957
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@scribu
scribu / wp.tidy
Created Aug 29, 2011
CSSTidy format for WordPress CSS
View wp.tidy
| {
|| {|
| |;|
}|
|
}
|||
|
View scb-hooks.php
<?php
/**
* @see http://scribu.net/wordpress/reflection-on-filters.html
*/
class scbHooks {
public static function add( $class ) {
self::_do( 'add_filter', $class );
}
View SplClassLoader.php
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
You can’t perform that action at this time.