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
<? | |
/* | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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 | |
/** | |
* Enable Vimeo API for oEmbed | |
*/ | |
function prefix_oembed_enable_vimeo_api( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) ) { | |
$provider = add_query_arg( array( | |
'api' => '1', | |
'player_id' => isset( $args['player_id'] ) ? $args['player_id'] : false |
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 | |
/** | |
* Add 'id' attribute to Vimeo oEmbed HTML | |
*/ | |
function prefix_embed_oembed_html( $html, $url, $attr, $post_ID ) { | |
$fix = true; | |
$fix &= strpos( $html, 'vimeo.com' ) !== false; // Embed code from Vimeo | |
$fix &= strpos( $html, ' id=' ) === false; // No ID attribute supplied by Vimeo | |
$fix &= isset( $attr['player_id'] ); // Player ID supplied |
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
-- Delete payments post meta lower then specific post ID | |
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'pronamic_payment' AND post_date <= '2013-11-14 15:34:26' ); | |
-- Delete payments posts lower then specific post ID | |
DELETE FROM wp_posts WHERE post_type = 'pronamic_payment' AND post_date <= '2013-11-14 15:34:26'; | |
-- Update the payments post ID reference | |
UPDATE wp_pronamic_ideal_payments SET post_id = null WHERE post_id NOT IN ( SELECT ID FROM wp_posts ); | |
-- Reset the database version option |
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 | |
/** | |
* Hooks into the "gform_validation" filter to test whether or not a new lead is a duplicate of another lead | |
* based upon their fields. | |
* | |
* @param mixed $validation_result | |
* | |
* @return mixed $validation_result | |
*/ |
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: Wink Bedug Crap | |
Description: Blah blah | |
*/ | |
if( isset( $_REQUEST["wpe_check_hooks"] ) ) { | |
global $wink; | |
if( empty( $wink ) ) { | |
//we need to set some starting variables here | |
$wink = new stdClass(); |
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
SELECT | |
vote.pollip_qid, | |
vote.pollip_aid, | |
answer.polla_answers, | |
COUNT( DISTINCT vote.pollip_ip ) | |
FROM | |
wp_pollsa AS answer | |
LEFT JOIN | |
wp_pollsip AS vote | |
ON answer.polla_aid = vote.pollip_aid |
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 prefix_woocommerce_sale_flash( $text ) { | |
$text = '<span class="onsale">'. __( 'Action!', 'text_domain' ). '</span>'; | |
return $text; | |
} | |
add_filter( 'woocommerce_sale_flash', 'prefix_woocommerce_sale_flash' ); |
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 | |
// Add at bottom of https://github.com/WordPress/WordPress/blob/3.8/wp-settings.php | |
$ip = $_SERVER['REMOTE_ADDR']; | |
if ( $ip == '0.0.0.0' ) { | |
// Test hook function | |
function test_filter_test() { | |
var_dump( $_POST ); |
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 | |
// With this filter you check wich filter breaks 'the_content' | |
function test_the_content( $content ) { | |
echo strlen( $content ), '<br />'; | |
} | |
add_filter( 'the_content', 'test_the_content', 0 ); | |
add_filter( 'the_content', 'test_the_content', 1 ); | |
add_filter( 'the_content', 'test_the_content', 10 ); |