Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Seperate Woocommerce reviews from comments and make a reviews moderation panel.
*/
class PL_Woo_Review_Mods {
function __construct() {
add_action( 'current_screen', array( $this, 'check_current_page' ), 10, 2 );
add_action( 'admin_menu', array( $this, 'add_product_reviews' ) );
}
function check_current_page( $screen ) {
@Pross
Pross / some.html
Created July 21, 2014 23:40
Disable animation on mobiles.
<script>
jQuery( document ).ready(function() {
var width = jQuery(window).width()
if( width < 480 )
jQuery('div').removeClass('pl-animation')
});
</script>
@Pross
Pross / functions.php
Created April 4, 2014 22:46
Remove thumbnail from single posts
<?php
function remove_post_thumbnail($metadata, $object_id, $meta_key, $single){
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() )
return false;
else
return $metadata;
}
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4);
@Pross
Pross / denyhosts.php
Last active December 16, 2015 16:19
DenyHosts for wordpress
<?php
/*
Plugin Name: DenyHosts
Plugin URI: http://pross.org.uk
Description: Block bad login attempts.
Version: 1.0
Author: Pross
*/
class DenyHosts {