View fix_bp_nextgen.php
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 ovi_kill_anonymous_hooks(){ | |
ovi_remove_anonymous_object_filter( | |
'wp_footer', | |
'C_Photocrati_Resource_Manager', | |
'print_marker' | |
); | |
} | |
add_action('wp_footer', 'ovi_kill_anonymous_hooks', -2); |
View dndrpawwd.php
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 | |
if ( strpos($_SERVER['SCRIPT_FILENAME'], 'wp-admin/index.php') && !defined('DOING_AJAX')) { | |
add_filter('the_posts', 'dndrpawwd', 10, 2); | |
} | |
function dndrpawwd($posts, $obj){ | |
$trace = debug_backtrace(); | |
foreach($trace as $item) { | |
if ($item['function'] == 'wp_dashboard_recent_posts' ) { |
View gist:3491627
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_action( 'template_redirect', 'redirect_visitors' ); | |
function redirect_visitors() { | |
if( is_user_logged_in() && (is_front_page() || is_home())) { | |
wp_redirect('http://ab.ovi/test2'); | |
exit; | |
} | |
} | |
?> |
View wpforms-split-name-smarttag-in-notifications.php
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_filter( 'wpforms_process_smart_tags', function ( $message, $form_data, $fields = '', $entry_id = 0 ) { | |
// CHANGE THIS FORM ID TO YOURS: | |
if ( 157 != $form_data['id'] ) { | |
return $message; | |
} | |
// So we are not submitting the form. | |
if ( empty( $entry_id ) ) { | |
return $message; |
View wpforms-hide-forms-on-mobile.php
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_filter( 'wpforms_frontend_load', function( $load, $form_data, $var ) { | |
// Comment these lines if you need to hide a certain form only. | |
if ( wp_is_mobile() ) { | |
return false; | |
} | |
// Or check certain form only. Uncomment. | |
/* |
View pvar.php
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 | |
/** | |
* Nicely display the var content. | |
* | |
* @param mixed $var | |
* @param bool $die | |
*/ | |
function pvar( $var = '', $die = false ) { | |
echo '<pre>' . PHP_EOL; |
View wpforms-reformat-payment-fields-values-in-emails.php
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 | |
/** | |
* Make "$40.00 - Second Choice" instead of "Second Choice - $40.00" | |
* for different payment fields. | |
*/ | |
add_filter( 'wpforms_html_field_value', function ( $value, $field, $form_data, $context ) { | |
if ( 'email-html' !== $context ) { | |
return $value; | |
} |
View wpforms-change-country-code.php
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_filter( 'wpforms_countries', function ( $countries ) { | |
$key_from = 'CA'; | |
if ( array_key_exists( $key_from, $countries ) ) { | |
$keys = array_keys( $countries ); | |
$keys[ array_search( $key_from, $keys, true ) ] = 'Canada'; |
View wpforms-export-change-separator.php
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 | |
// For WPForms < v1.5.5, but should work with the latest version as well. | |
add_filter( | |
'wpforms_csv_export_separator', | |
function( $sep ) { | |
return ';'; | |
} | |
); |
View bp-prevent-duplicate-group-names.php
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 pp_check_group_name( $group_new ) { | |
if ( 'group-details' == bp_get_groups_current_create_step() ) { | |
$args = array( | |
'per_page' => null, | |
'populate_extras' => false, | |
'update_meta_cache' => false | |
); |
OlderNewer