Skip to content

Instantly share code, notes, and snippets.

@ryanl4321
ryanl4321 / wp-config.php
Last active July 26, 2017 20:31
some good tings to start
define( 'DISALLOW_FILE_EDIT', true );
define('WP_AUTO_UPDATE_CORE', 'minor');
define('WP_SITEURL', 'https://'.$_SERVER['SERVER_NAME']);
define('WP_HOME', 'https://'.$_SERVER['SERVER_NAME']);
<?php
class new_general_setting {
private $field_name = false;
private $field_label = false;
private $field_type = false;
function __construct($field_name, $field_label=false, $field_type='text'){
$this->field_name = $field_name;
$this->field_label = $field_label ? $field_label : str_replace('_',' ',$field_name);
$this->field_type = $field_type;
@ryanl4321
ryanl4321 / blogs-menu.php
Last active December 23, 2015 19:55
WordPress Multisite: List of all blogs
<?php
// This code was used to generate a menu showing all blogs on a WordPress
// Multisite installation.
// The shortcode [bloglist] was used in the homepage of the main blog to link to
// all the other blogs.
// Output a single menu item
function bloglist_entry($id, $title, $link_self){
global $blog_id;
if ($id == $blog_id && !$link_self){ return; }