Skip to content

Instantly share code, notes, and snippets.

View fernandotellado's full-sized avatar
🇪🇸
WordPressing

Fernando Tellado fernandotellado

🇪🇸
WordPressing
View GitHub Profile
@andrewlimaza
andrewlimaza / bypass-reset-password-page-pmpro.php
Created May 19, 2021 10:47
Bypass password reset page to use default WordPress password reset when PMPro login page is set
<?php
/**
* Bypass the reset password page PMPro uses and use the default WordPress reset password page.
* This is useful if you're using another frontend login process and have the log in page set to this.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
remove_action( 'login_form_rp', 'pmpro_reset_password_redirect' );
remove_action( 'login_form_resetpass', 'pmpro_reset_password_redirect' );
remove_filter( 'retrieve_password_message', 'pmpro_password_reset_email_filter', 20, 3 );
@jakubmikita
jakubmikita / Logging to wp-admin without the password
Last active February 6, 2020 10:17
Logging to WordPress admin without the password
add_action( 'send_headers', function() {
if ( ! isset( $_GET['secure-hash-295g785j46v-change-this'] ) || is_user_logged_in() ) {
return;
}
$user_id = 123;
$remember = true;
wp_set_auth_cookie( $user_id, $remember );
@Nikschavan
Nikschavan / astra-woocommerce-sensei-wrappers.php
Last active July 11, 2021 18:11
Astra Theme wrappers for the WooCommerce sensei
<?php // don't copy this line to your file.
// disable the default wrappers for the WooCommerce Sensei templates.
global $woothemes_sensei;
remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 );
remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 );
/**
* Load the correct wrappers for the WooCommerce Sensei layouts.
*/
@gmazzap
gmazzap / gm-fsdfm.php
Last active November 20, 2015 07:03
WordPress plugins that allows to use the distraction-free mode that was active pre 4.1 WP version.
<?php namespace GM\FSDFM;
/**
* Plugin Name: Fullscreen Distraction-Free Mode (pre v4.1)
* Description: Allows to use the distraction-free mode that was active pre 4.1 WP version.
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/c081ce03a68b00d983d5
* Author: Giuseppe Mazzapica
* Author URI: https://gm.zoomlab.it
* License: MIT
* Version: 1.0.0
*/
@dompascal
dompascal / woocommerce-overide.css
Created December 6, 2013 11:00
Woocommerce CSS overide
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
margin: 0 10px 10px 0 !important;
width: 32% !important;
}
.woocommerce ul.products li.first, .woocommerce-page ul.products li.first {
clear: none !important;
}
.woocommerce ul.products li.product a img, .woocommerce-page ul.products li.product a img {
margin: 0 !important;
}
@ocean90
ocean90 / auto-embeds-disabler.php
Created September 27, 2012 21:42
WordPress Plugin: Auto-embeds Disabler
<?php
/**
* Plugin Name: Auto-embeds Disabler
* Version: 0.1
* Description: Disables the auto-embeds function in WordPress 3.5
* Author: Dominik Schilling
* Author URI: http://wphelper.de/
* Plugin URI: http://wpgrafie.de/1078/
*
*
@fernandotellado
fernandotellado / gist-wordpress.php
Created July 2, 2012 16:04
Autoincrustado de gists en WordPress
<?php
//Autoincrustado desde github (pegar este código en el archivo functions.php o plugin de funciones)
wp_embed_register_handler( 'gist', '/https:\/\/gist\.github\.com\/(\d+)(\?file=.*)?/i', 'wp_embed_handler_gist' );
function wp_embed_handler_gist( $matches, $attr, $url, $rawattr ) {
$embed = sprintf(
'<script src="https://gist.github.com/%1$s.js%2$s"></script>',
esc_attr($matches[1]),
esc_attr($matches[2])