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 redirect_to_new_domain(){ | |
if( (strpos($_SERVER['HTTP_HOST'], 'domain.com') !== false) || (strpos($_SERVER['HTTP_HOST'],'www.domain.com')!== false) ){ | |
wp_redirect( 'https://www.new-domain.com'.$_SERVER['REQUEST_URI'] , 301); | |
exit; | |
} | |
} | |
add_action("init","redirect_to_new_domain"); |
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 | |
//github plugin url: https://github.com/hissy/rs-csv-importer | |
//wp plugin directory url: http://wordpress.org/plugins/really-simple-csv-importer/ | |
//add to your functions.php in current child theme or create a child theme using any plugin/website | |
function really_simple_csv_importer_save_meta_filter( $meta, $post, $is_update ) { | |
if( isset($meta['header_image']) ){ | |
include_once( ABSPATH . 'wp-admin/includes/image.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 my_password_form() { | |
global $post; | |
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); | |
$o = '<form class="protected-post-form" action="' . get_option( 'siteurl' ) . '/wp-pass.php" method="post"> | |
' . __( "To view this protected post, enter the password below:" ) . ' | |
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /> | |
</form> | |
'; | |
return $o; |
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 memberpress__get_all_memberships( $user_id = false ){ | |
if( class_exists('MeprUser') ){ | |
if( ! $user_id ){ | |
$user_id = get_current_user_id(); | |
} | |
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
/** | |
* Returns a user meta value | |
* Usage [um_user user_id="" meta_key="" ] // leave user_id empty if you want to retrive the current user's meta value. | |
* meta_key is the field name that you've set in the UM form builder | |
* You can modify the return meta_value with filter hook 'um_user_shortcode_filter__{$meta_key}' | |
*/ | |
function um_user_shortcode( $atts ) { | |
$atts = extract( shortcode_atts( array( | |
'user_id' => get_current_user_id(), | |
'meta_key' => '', |
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 | |
/** | |
* Pre-populate Woocommerce checkout fields | |
* Note that this filter populates shipping_ and billing_ fields with a different meta field eg 'first_name' | |
*/ | |
add_filter('woocommerce_checkout_get_value', function($input, $key ) { | |
global $current_user; | |
switch ($key) : |
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
$( document ).ready(function() { | |
$("classNameOrID").hover(function(){ | |
// Get the current title | |
var title = $(this).attr("title"); | |
// Store it in a temporary attribute | |
$(this).attr("tmp_title", title); | |
// Set the title to nothing so we don't see the tooltips |
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: Godaddy Login error on Wrong Password | |
* Version: 0.1 | |
* Plugin URI: https://www.fiverr.com/wppluginexpert | |
* Description: TO FIX THE GODADDAYBUG | |
* Author: WPPLUGINEXPERT | |
* Author URI: https://www.fiverr.com/wppluginexpert | |
* Requires at least: 4.0 | |
* Tested up to: 5.2.3 |
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 sure the function does not exist before defining it | |
*/ | |
if( ! function_exists( 'remove_class_filter' ) ){ | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback |
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
function myfunctiontoaddmailme($errors){ | |
$withoutLostPassword = ''; | |
if( $errors === '<strong>ERROR</strong>: Invalid username. <a href="https://nicolethemathlady.com/my-account/lost-password/">Lost your password?</a>' ){ | |
$withoutLostPassword = '<strong>ERROR</strong>: Not Sure about the Username?, Then <a href="mailto:[email protected]?subject=Account Issue">Mail Me!</a> '; | |
$errors = $withoutLostPassword; | |
} | |
else if( $errors === '<strong>ERROR</strong>: Invalid email address. <a href="https://nicolethemathlady.com/my-account/lost-password/">Lost your password?</a>' ){ | |
$withoutLostPassword = '<strong>ERROR</strong>: Not Sure about the Email?, Then <a href="mailto:[email protected]?subject=Account Issue">Mail Me!</a> '; | |
$errors = $withoutLostPassword; | |
} |
NewerOlder