Skip to content

Instantly share code, notes, and snippets.

View MisterWP's full-sized avatar

Nicolas Laruelle MisterWP

View GitHub Profile
@MisterWP
MisterWP / warning.css
Last active November 21, 2015 19:12
Comment Form Message JetPack & everywhere
/* Message pour formulaire de commentaires offert par : http://www.mister-wp.com/code/comment-form-message-jetpack/ */
#myCommentPolicy {
border:1px solid #CCC;
padding:5px 20px;
border-radius:20px;
background-color:#FFF;
margin-bottom:25px;
font-size:13px;
line-height:1.5em;
overflow-y: scroll;
@MisterWP
MisterWP / chownnobody.sh
Created September 12, 2017 06:05 — forked from inetbiz/chownnobody.sh
cPanel user nobody chown to cp user
#!/bin/bash
# Script to fix permissions of cpanel nobody file and folders
# Written by: Denver Prophit Jr. 03/13/2015
# https://www.strikehawk.com
for user in `ls -A /var/cpanel/users`
do
HOMEDIR=$(egrep "^${user}:" /etc/passwd | cut -d: -f6)
find $HOMEDIR ! -user $USER -exec chown $USER {} \;
done
@MisterWP
MisterWP / plugin-localisateur.php
Created May 24, 2018 15:45
Ajouter un localisateur à votre site WordPress
<?php
/*
Plugin Name: Localisateur de magasin
Description: Ajouter des magasins facilement à une Google Map
Version: 0.1
License: GPL
Author: Eric VAlois
Author URI: http://bulledev.com
*/
?>
@MisterWP
MisterWP / unzip.php
Created November 15, 2018 06:46 — forked from kirtan403/unzip.php
PHP script to remotely zip/unzip archives of your FTP
<?php
function show($str){
echo $str . "<br/>\n";
flush();
ob_flush();
}
$archiveDir = "temp";
<?php
/*
ZIP the /wp-content/ directory from the root folder.
Just put it in your root directory, go to example.com/zip.php, wget from your new server and unzip inside your new wp-content.
The other files have to be get in a freshely downloaded WordPress release.
*/
/* ZIP File name and path */
$zip_file = 'wp-content.zip';
/*-----------------------------------------------------------------------------------*/
/* WooCommerce - Change Checkout Notes Label and Place Holder Text
/*-----------------------------------------------------------------------------------*/
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'theme_override_checkout_notes_fields' );
// Our hooked in function - $fields is passed via the filter!
function theme_override_checkout_notes_fields( $fields ) {
$fields['order']['order_comments']['placeholder'] = 'Add some order notes or a gift message here.';
<?php
/**
* Plugin Name: Disable Updates
* Description: This Must Use plugin is just here to prevent broken webistes. It can easyly be disabled by remove the mu-plugin/disable-updates.php in /wp-content/. Credit : https://www.mister-wp.com :-)
* Author: Mister WordPress
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
<?php
/**
* The main plugin file
*
* @package WordPress_Plugins
* @subpackage OS_Disable_WordPress_Updates
*/
/*
Plugin Name: Disable All WordPress Updates
@MisterWP
MisterWP / wc-disable-any-repeat-purchase.php
Created January 9, 2020 09:55 — forked from bekarice/wc-disable-any-repeat-purchase.php
Disables Repeat Purchase for any WooCommerce product
<?php
/**
* Disables repeat purchase for products / variations
*
* @param bool $purchasable true if product can be purchased
* @param \WC_Product $product the WooCommerce product
* @return bool $purchasable the updated is_purchasable check
*/
function sv_disable_repeat_purchase( $purchasable, $product ) {
@MisterWP
MisterWP / wp-custom-post-type-feed.php
Last active March 12, 2022 05:21
wp-custom-post-type-feed.php
<?php
/**
* @package WP Custom Post Type Feed
* @version 0.1
*/
/*
Plugin Name: WP Custom Post Type Feed
Plugin URI: https://www.easyhoster.com/probleme-indexation/
Description: Create RSS Feed for WordPress Pages & Custom Post Types
Author: EasyHoster