Skip to content

Instantly share code, notes, and snippets.

@timba64
timba64 / gitignore-for-wp
Created July 16, 2021 17:39 — forked from samhotchkiss/gitignore-for-wp
Basic Gitignore for WordPress
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@timba64
timba64 / function.php
Last active October 25, 2021 14:13 — forked from nandomoreirame/function.php
WordPress REST API send email SMTP in with PHPMailer
<?php
function sendWithPhpMailer($subject, $body, $reply) {
require(ABSPATH . WPINC . '/class-phpmailer.php');
require(ABSPATH . WPINC . '/class-smtp.php');
// date_default_timezone_set( 'America/Sao_Paulo' );
$blogname = wp_strip_all_tags( trim( get_option( 'blogname' ) ) );
$smtpHost = wp_strip_all_tags( trim( get_option( 'smtp_host' ) ) );
@timba64
timba64 / kinsta-share-users.php
Created April 24, 2019 06:56 — forked from carlodaniele/kinsta-share-users.php
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@timba64
timba64 / .htaccess
Last active October 26, 2018 09:28 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server and some others rules
# last working way - http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
</IfModule>
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]