Skip to content

Instantly share code, notes, and snippets.

function cssklassen_menu_classes($classes, $item) {
$classes = array_filter(
$classes,
create_function( '$class',
'return in_array( $class,
array( "menu-item", "current-menu-item", "current-menu-parent" ) );' )
);
return array_merge(
$classes,
(array)get_post_meta( $item->ID, '_menu_item_classes', true )
function remove_tags_status() {
global $wp_taxonomies;
$tax = 'status';
if( taxonomy_exists( $tax ) )
unset( $wp_taxonomies[$tax] );
}
add_action( 'init', 'remove_tags_status' );
function restrict_books_by_genre() {
global $typenow;
$post_type = 'wohnheim'; // change HERE
$taxonomy = array('wohnmoeglichkeiten', 'region', 'traeger'); // change HERE
if ($typenow == $post_type) {
$selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : '';
$info_taxonomy = get_taxonomy($taxonomy);
wp_dropdown_categories(array(
'show_option_all' => __("Alle Wohnheimkategorien {$info_taxonomy->label}"),
'taxonomy' => $taxonomy,
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
if ( ! function_exists( 'unregister_post_type' ) ) :
function unregister_post_type() {
global $wp_post_types;
if ( isset( $wp_post_types[ 'expose' ] ) ) {
unset( $wp_post_types[ 'expose' ] );
return true;
}
return false;
}
endif;
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2015.09.14
* license: MIT
*/
/* === Template === */
/*
@ingozoell
ingozoell / wp-email-spam-protection.php
Last active September 29, 2016 16:44
WordPress E-Mail Spam Protection via Shortcode Hide Email from Spam Bots using a shortcode place this in your functions file
/* Shortcode spam-protected HTML "mailto"
* [email]
*
*/
function iz_email_protection($atts , $content = null ){
if ( ! is_email ($content) )
return;
return '<a href="mailto:'.antispambot($content).'">'.antispambot($content).'</a>';
}
$(window).bind('resize', function(e)
{
window.resizeEvt;
$(window).resize(function()
{
clearTimeout(window.resizeEvt);
window.resizeEvt = setTimeout(function()
{
//code to do after window is resized
}, 250);
function child_remove_parent_function() {
remove_action( 'init', 'parent_function' );
}
add_action( 'wp_loaded', 'child_remove_parent_function' );
@ingozoell
ingozoell / wp-bug-plugin-relevanssi.sql
Last active November 7, 2017 13:23
WP BUG | Plugin: Relevanssi - A Better Search Database Import Problem Stopwords-Table Collation Error https://wordpress.org/support/topic/database-import-problem-stopwords-table-collation-error
[...] utf8_bin =>
[...] utf8mb4_bin