Skip to content

Instantly share code, notes, and snippets.

View lanche86's full-sized avatar

Milan Ivanovic lanche86

View GitHub Profile
@lanche86
lanche86 / index.php
Created August 27, 2013 07:10
Remove quick edit for custom post type
// 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
lanche86 / ownfilters.txt
Created September 16, 2013 08:53
Adblock Plus Options, own filters
apkmania.co##div#sidebar
blic.rs##*.swf
blic.rs##a.brand_left
blic.rs##a.brand_right
blic.rs##a.slg
blic.rs##div#buzzBox
blic.rs##div#dw_feed
blic.rs##div#footer
blic.rs##div#home_tabz
@lanche86
lanche86 / BuddyPress autologin on activation
Last active December 29, 2015 09:18
Automatically logs in the user and redirects them to their profile when they activate their account.
<?php
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
lanche86 / international_date_formats.php
Created December 7, 2013 22:03
International date formats by allowing the users to set their own date formats in Settings / General
<?php the_time( get_option( 'date_format' ) ); ?>
@lanche86
lanche86 / force-admin-bar.php
Created January 3, 2014 23:39
Force the WordPress Admin Bar to display for all visitors. Even Logged Out Users can use the Admin Bar.
/*
* Force the WordPress Admin Bar to display for all visitors
*/
add_filter( 'show_admin_bar', '__return_true' );
@lanche86
lanche86 / gist:8383123
Created January 12, 2014 10:48
Remove empty p tags from ACF
// ACF fix to remove <p></p>
remove_filter( 'acf_the_content', 'wpautop' );
<?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' ) );