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 | |
/** | |
* Delete a post meta transient. | |
*/ | |
function delete_post_meta_transient( $post_id, $transient, $value = null ) { | |
global $_wp_using_ext_object_cache; | |
$post_id = (int) $post_id; | |
do_action( 'delete_post_meta_transient_' . $transient, $post_id, $transient ); |
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
/** | |
* Disables BuddyPress' registration process and fallsback to WordPress' one. | |
*/ | |
function my_disable_bp_registration() { | |
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' ); | |
remove_action( 'bp_screens', 'bp_core_screen_signup' ); | |
} | |
add_action( 'bp_loaded', 'my_disable_bp_registration' ); |
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 my_pre_user_query( $query ) { | |
$where = get_posts_by_author_sql( 'post' ) . " AND MONTH(post_date) = " . date( 'm', strtotime( '-1 month' ) ); | |
$query->query_from = str_replace( get_posts_by_author_sql( 'post' ), $where, $query->query_from ); | |
$query->query_where .= " AND post_count > 0 "; | |
$query->query_limit .= " LIMIT 5 "; | |
} | |
function my_magic_loop() { |
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
/* source: all over the interwebz */ | |
/*------------------------ Smartphones ------------------------ */ | |
/* Portrait & Landscape */ | |
@media only screen | |
and (min-width : 320px) | |
and (max-width : 480px) { | |
/* styles */ | |
} | |
/* Landscape */ |
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 | |
/* | |
Plugin Name: Test | |
*/ | |
class My_Like_Button { | |
function __construct() | |
{ | |
$this->hooks(); | |
} |