Skip to content

Instantly share code, notes, and snippets.

View RyuuZaky's full-sized avatar

Andres Gonzalez RyuuZaky

View GitHub Profile
@RyuuZaky
RyuuZaky / wordpress-hide-editor.php
Created November 12, 2016 16:46
Hide content editor on defined pages in Wordpress
/**
* Hide the main editor on specific pages
*/
define('EDITOR_HIDE_PAGE_TITLES', json_encode(array()));
define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php')));
/**
* Hide the main editor on defined pages
*
@RyuuZaky
RyuuZaky / hide-editor.php
Created November 12, 2016 16:35 — forked from ramseyp/hide-editor.php
Hide the content editor for certain pages in WordPress
<?php
/**
* Hide editor on specific pages.
*
*/
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
// Get the Post ID.
@RyuuZaky
RyuuZaky / gist:fe9ad6d2282721f53e98246df33f1ec8
Created October 24, 2016 03:41 — forked from ymirpl/gist:1052094
Python unicode e-mail sending
#coding: utf-8
from cStringIO import StringIO
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email import Charset
from email.generator import Generator
import smtplib
# Example address data
@RyuuZaky
RyuuZaky / gist:3feac27fd1fc54675ea9d46226c20164
Created October 21, 2016 03:39 — forked from thomasgriffin/gist:4159035
Add custom post types to search results in WordPress.
<?php
add_filter( 'pre_get_posts', 'tgm_io_cpt_search' );
/**
* This function modifies the main WordPress query to include an array of
* post types instead of the default 'post' post type.
*
* @param object $query The original query.
* @return object $query The amended query.
*/
function tgm_io_cpt_search( $query ) {
@RyuuZaky
RyuuZaky / wordpress-query-args.php
Last active November 12, 2016 19:50 — forked from billerickson/gist:3698476
Wordpress Query Arguments ($args)
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@RyuuZaky
RyuuZaky / nginx-403-forbidden-error-hosting-in-user-home-directory.md
Created March 21, 2016 03:24 — forked from jhjguxin/nginx-403-forbidden-error-hosting-in-user-home-directory.md
nginx 403 forbidden error when server static file under user home directory