This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create directory and init as --bare repo | |
*/ | |
mkdir repo && cd repo | |
mkdir site.git && cd site.git | |
git init --bare | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); | |
remove_post_type_support($post_type, 'trackbacks'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom wordpress error database connection page | |
* @put this file on your wp-content/ folder. | |
* @name file : db-error.php | |
* | |
*/ | |
header('HTTP/1.1 503 Service Temporarily Unavailable'); | |
header('Status: 503 Service Temporarily Unavailable'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom metabox to change priority displaying courses | |
* ==================================================== | |
*/ | |
add_action( 'add_meta_boxes', 'tj_amb_priority_courses' ); | |
function tj_amb_priority_courses() { | |
add_meta_box( 'tj_mb_priority_courses', 'Display Priority', 'tj_mb_priority_courses_cb', 'sfwd-courses', 'side', 'high' ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: MHT Domain Search | |
* Description: Page template domain registration for mega high tech. | |
* Author: Lafif Astahdziq | |
* Author URI: http://astahdziq.in/ | |
* Version: 1.0 | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Batch Add user to buddypress group | |
*/ | |
add_action('load-users.php',function() { | |
if(isset($_POST['action']) && ($_POST['action'] == 'groupadd') && isset($_POST['bp_gid']) && isset($_POST['allusers'])) { | |
// print_r($_POST); exit(); | |
$group_id = $_POST['bp_gid']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Custom table example | |
Description: example plugin to demonstrate wordpress capatabilities | |
Plugin URI: http://mac-blog.org.ua/ | |
Author URI: http://mac-blog.org.ua/ | |
Author: Marchenko Alexandr | |
License: Public Domain | |
Version: 1.1 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filter_content_match_protocols( $content ) { | |
$search = $replace = get_bloginfo( 'home' ); | |
if ( ! preg_match( '|/$|', $search ) ) | |
$search = $replace = "$search/"; | |
if ( is_ssl() ) { | |
$search = str_replace( 'https://', 'http://', $search ); | |
$replace = str_replace( 'http://', 'https://', $replace ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* parse path to get from clean URL | |
* @return [array] [array of requested uri] | |
*/ | |
function parse_path() { | |
$path = array(); | |
if (isset($_SERVER['REQUEST_URI'])) { | |
$request_path = explode('?', $_SERVER['REQUEST_URI']); |