This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Assumes within the WordPress Loop | |
$args = array ('title' => $post->post_title); | |
if ( strlen( $img = get_the_post_thumbnail( get_the_ID() ) ) ) { | |
/* display thumbnail */ | |
the_post_thumbnail( 'thumbnail', $args ); | |
} else { | |
delete_post_meta( $post->ID, '_thumbnail_id' ); | |
//Requires Auto Post Thumbnails plugin - http://wordpress.org/extend/plugins/auto-post-thumbnail/ | |
if ( function_exists( 'apt_publish_post' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//For setting the multisite language | |
function sp_modify_locale(){ | |
return 'ja_JP'; //change this | |
} | |
add_filter('locale','sp_modify_locale'); | |
add_filter( 'bbpress_locale', 'sp_modify_locale' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_form_tag', 'gform_form_tag_autocomplete', 11, 2 ); | |
function gform_form_tag_autocomplete( $form_tag, $form ) { | |
if ( is_admin() ) return $form_tag; | |
if ( GFFormsModel::is_html5_enabled() ) { | |
$form_tag = str_replace( '>', ' autocomplete="off">', $form_tag ); | |
} | |
return $form_tag; | |
} | |
add_filter( 'gform_field_content', 'gform_form_input_autocomplete', 11, 5 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tango_smilies_fixurl($text) { | |
$siteurl = get_option('siteurl'); | |
$plugurl = plugin_dir_url(__FILE__); | |
$search = sprintf( '#<img src="%s/wp-includes/images/smilies/#', $siteurl ); | |
$replace = sprintf( '<img src="%stango/', $plugurl ); | |
return preg_replace( $search, $replace, $text ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'slash_edit_endpoint', 'rjh_slash_edit_endpoint' ); | |
function rjh_slash_edit_endpoint( $endpoint ) { | |
return 'edición'; //ends up as edicion since accents are removed | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'template_redirect', 'rjh_remove_frizzly_content' ); | |
function rjh_remove_frizzly_content() { | |
if ( isset( $_GET[ 'woocommerce_gpf' ] ) ) { | |
remove_filter( 'the_content', 'frizzly_the_content_filter' ); | |
remove_filter( 'the_excerpt', 'frizzly_the_excerpt_filter' ); | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Place code in custom plugin | |
Get awesome minify plugin (Minit) by Kaspars D. - https://github.com/kasparsd/minit | |
to work with crazy, but often necessary, Jetpack Sharing - https://wordpress.org/plugins/jetpack/ | |
Written by Ronald Huereca (@ronalfy). Powered by lack of Sleep(TM) and Vodka(R). | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Tested in a theme's functions.php, but not in a plugin | |
//Allow overriding of editor | |
class opubco_user_optin { | |
public function __construct() { | |
add_action( 'personal_options', array( &$this, 'add_interface' ) ); | |
//User update action | |
add_action( 'edit_user_profile_update', array( &$this, 'save_user_profile' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Place in wp-config.php | |
if ( isset( $_SERVER[ 'REMOTE_ADDR' ] ) && ( '127.0.0.1' == $_SERVER['REMOTE_ADDR'] || '::1' == $_SERVER['REMOTE_ADDR'] ) ) { | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_DISPLAY', true ); | |
define( 'SCRIPT_DEBUG', true ); | |
define( 'CONCATENATE_SCRIPTS', false ); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function opubco_localhost() { | |
// Do check for localhost IP (remove this if you want to ALWAYS display it) | |
if ( '127.0.0.1' != $_SERVER['REMOTE_ADDR'] && '::1' != $_SERVER['REMOTE_ADDR'] ) { | |
return; | |
} | |
if ( defined( 'WP_DEBUG' ) && WP_DEBUG == true ) { | |
$debug = 'WP_DEBUG=ON'; | |
} else { | |
$debug = 'WP_DEBUG=OFF'; |
OlderNewer