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( 'pre_option_image_default_align', '__image_default_align' ); | |
function __image_default_align() { | |
return 'left'; | |
} | |
add_filter( 'pre_option_image_default_link_type', '__image_default_link_type' ); | |
function __image_default_link_type() { | |
return 'none'; | |
} |
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: Add "Animal" custom taxonomy | |
Description: Add the new custom taxonomy "animal", don't forget to flush your permalinks! | |
Author: Julio Potier | |
Author URI: http://boiteaweb.fr | |
*/ | |
/* !---------------------------------------------------------------------------- */ | |
/* ! REGISTER TAXONOMIES */ |
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
echo '<span>Familles<br>'; | |
$terms_id = _get_term_hierarchy( 'animal' ); | |
$post_terms = get_the_terms( $post->ID, 'animal' ); | |
$terms_id = array_intersect_key( $terms_id, $post_terms ); | |
foreach ( $terms_id as $parent => $enfants ) { | |
$term_links = rtrim( $term_links, ', ' ); | |
if ( ! empty( $term_links) ){ | |
$term_links .= '<br />'; | |
} | |
$term = get_term( $parent, 'animal' ); |
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( 'preprocess_comment', 'baw_no_double_thread' ); | |
function baw_no_double_thread( $comment ) | |
{ | |
if ( current_user_can( 'administrator' ) ) { | |
return $comment; | |
} | |
global $wpdb; | |
if ( ! $comment['comment_parent'] ) { | |
$c = $wpdb->get_var( $wpdb->prepare( 'SELECT comment_ID FROM '.$wpdb->comments.' WHERE comment_post_ID = %d AND comment_author_email = %s AND comment_parent = 0', $comment->comment_post_ID, $comment['comment_author_email'] ) ); | |
if ( (int) $c > 0 ) { |
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_action( 'wp_footer', 'infinite_load' ); | |
function infinite_load() { | |
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; | |
?> | |
<script> | |
jQuery(document).ready(function($){ | |
if( window.history && history.pushState ) { | |
var $page = <?php echo $paged; ?>; |
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_action( 'wp_scheduled_delete', 'delete_expired_db_transients' ); | |
function delete_expired_db_transients() { | |
if ( wp_using_ext_object_cache() ) { // magic | |
return; | |
} | |
global $wpdb; | |
$time = isset( $_SERVER['REQUEST_TIME'] ) ? (int) $_SERVER['REQUEST_TIME'] : time(); |
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( 'template_include', 'template_comment_paginated' ); | |
function template_comment_paginated( $template ) | |
{ | |
if ( (int) get_query_var( 'cpage' ) > 0 && | |
false !== ( $_template = str_replace( '.php', '-paged.php', $template ) ) && | |
file_exists( $_template ) ) | |
{ | |
return $_template; | |
} | |
return $template; |
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( 'wp_redirect', 'baw_hack_delete_post_redirect' ); | |
function baw_hack_delete_post_redirect( $url ) { | |
$ref = wp_get_referer(); | |
if ( strpos( $ref, admin_url() ) === false | |
&& isset( $_GET['action'], $_GET['post'] ) | |
&& ( ( 'delete' == $_GET['action'] && check_admin_referer('delete-post_' . $_GET['post'] ) ) | |
|| ( 'trash' == $_GET['action'] && check_admin_referer('trash-post_' . $_GET['post'] ) ) | |
) | |
) { | |
return home_url(); |
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: Patch WooCommerce 2.3.10 -> 2.3.11 - Object Inhection Vulnerability | |
Author: SecuPress | |
*/ | |
add_action( 'plugins_loaded', 'patch_woocommerce_2310', 1 ); | |
function patch_woocommerce_2310() { | |
if ( isset( $_REQUEST['cm'] ) ) { | |
$raw_custom = $_REQUEST['cm']; | |
$custom = sanitize_text_field( stripslashes( $_REQUEST['cm'] ) ); |
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: Password Reset Removed | |
* Description: Removes the ability for non admin users to change/reset their passwords. | |
* Version: 1.1 | |
* Author: Derek Herman ; Modified by Juliobox (boiteaweb.fr) | |
* Author URI: http://valendesigns.com | |
*/ | |
add_filter( 'show_password_fields', 'baw_prr_i_am_admin' ); | |
add_filter( 'allow_password_reset', 'baw_prr_i_am_admin' ); |
OlderNewer