Skip to content

Instantly share code, notes, and snippets.

Milan lanche86

Block or report user

Report or block lanche86

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 force-css-js-to-go-live-immediately.php
// Version CSS file in a theme
wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array(), filemtime( get_stylesheet_directory() . '/style.css' ) );
// Version JS file in a theme
wp_enqueue_script( 'theme-scripts', get_stylesheet_directory_uri() . '/js/scripts.js', array(), filemtime( get_stylesheet_directory() . '/js/scripts.js' ) );
lanche86 / gist:8383123
Created Jan 12, 2014
Remove empty p tags from ACF
View gist:8383123
// ACF fix to remove <p></p>
remove_filter( 'acf_the_content', 'wpautop' );
lanche86 / force-admin-bar.php
Created Jan 3, 2014
Force the WordPress Admin Bar to display for all visitors. Even Logged Out Users can use the Admin Bar.
View force-admin-bar.php
* Force the WordPress Admin Bar to display for all visitors
add_filter( 'show_admin_bar', '__return_true' );
lanche86 / international_date_formats.php
Created Dec 7, 2013
International date formats by allowing the users to set their own date formats in Settings / General
View international_date_formats.php
<?php the_time( get_option( 'date_format' ) ); ?>
lanche86 / BuddyPress autologin on activation
Last active Dec 29, 2015
Automatically logs in the user and redirects them to their profile when they activate their account.
View BuddyPress autologin on activation
add_action( "bp_core_activated_user", "bp_autologin_on_activation", 40, 3 );
function bp_autologin_on_activation( $user_id, $key, $user) {
global $bp, $wpdb;
//simulate Bp activation
lanche86 / ownfilters.txt
Created Sep 16, 2013
Adblock Plus Options, own filters
View ownfilters.txt*.swf
lanche86 / index.php
Created Aug 27, 2013
Remove quick edit for custom post type
View index.php
// remove quick edit for custom post type
// not needed if Title is removed
add_filter( 'post_row_actions', 'remove_row_actions', 10, 2 );
function remove_row_actions( $unset_actions, $post ) {
global $current_screen;
if ( $current_screen->post_type != 'custom_redirect' ) return $unset_actions;
unset( $unset_actions['edit'] );
lanche86 / index.php
Created Aug 12, 2013
Automatically Remove Links from WordPress Images
View index.php
// Automatically Remove Links from WordPress Images
add_filter( 'the_content', 'attachment_image_link_remove_filter' );
function attachment_image_link_remove_filter( $content ) {
$content = preg_replace( array( '{<a(.*?)(wp-att|wp-content/uploads)[^>]*><img}', '{ wp-image-[0-9]*" /></a>}' ),
array( '<img','" />' ), $content );
return $content;
lanche86 / index.html
Created Aug 11, 2013
Absolute Horizontal And Vertical Centering In CSS
View index.html
I am Horizontal and Vertical centered only by CSS!
lanche86 / index.html
Created Jun 13, 2013
A CodePen by tomasz stryjewski. pure css fancy radio group
View index.html
<fieldset class="radioset">
<li><input type="radio" name="radio[]" id="radio1" checked><label for="radio1">foo</label>
<li><input type="radio" name="radio[]" id="radio2"><label for="radio2">bar</label>
<li><input type="radio" name="radio[]" id="radio3"><label for="radio3">baz</label>
<li><input type="radio" name="radio[]" id="radio4"><label for="radio4">qux</label>
You can’t perform that action at this time.