This file contains 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 | |
/** | |
* Redirect from wp-login.php | |
* @link http://stackoverflow.com/a/1976804/1743124 | |
*/ | |
function mayeenulislam_wp_login_redirect(){ | |
if( isset($_GET['action']) && $_GET['action'] == 'register' ) { | |
wp_redirect( home_url('/register') ); //i.e. http://example.com/register | |
exit(); | |
} else if( isset($_GET['action']) && $_GET['action'] == 'lostpassword' ) { |
This file contains 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
# ---------------------------------------------------------------------- | |
# | Compression | | |
# ---------------------------------------------------------------------- | |
<IfModule mod_deflate.c> | |
# Force compression for mangled `Accept-Encoding` request headers | |
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html | |
<IfModule mod_setenvif.c> |
This file contains 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 | |
/** | |
* db QUERIES | |
* Prerequisite: define('SAVEQUERIES', true) | |
*/ | |
function nano_enqueue_db_queries() { | |
global $wpdb; | |
echo '<h2>Database Last Query</h2>'; | |
echo $wpdb->last_query; | |
echo '<hr>'; |
This file contains 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 | |
/** | |
* According to the lhrec_106's answer at StackOverflow | |
* http://stackoverflow.com/a/17339542/1743124 | |
*/ | |
$jQueryLatestURI = "http://code.jquery.com/jquery-latest.min.js"; | |
@$connection = fopen( $jQueryLatestURI, "r" ); |
This file contains 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 | |
function init_url_rewrite_rule(){ | |
add_rewrite_endpoint( 'edit',EP_PERMALINK | EP_PAGES | EP_ATTACHMENT ); | |
if(get_option("EDIT_REWRITE_RULE")!=1){ | |
flush_rewrite_rules(); | |
update_option("EDIT_REWRITE_RULE",1); | |
} | |
} | |
function redirect_edit_url(){ |
This file contains 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 | |
/** | |
* Tutorial by: nanodesigns (@nanodesigns) | |
* URL: http://tuts.nanodesignsbd.com/change-wordpress-password-without-sql-manager/ | |
* by: Mayeenul Islam (@mayeenulislam) | |
*/ | |
//Connect to mySQL First | |
$connection = mysql_connect('DB_HOST','DB_USER','DB_PASSWORD'); | |
This file contains 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 | |
$data_dir = 'c:/server/www/dev/data/'; | |
$releases = [ ]; | |
foreach ( range( 3.2, 4.0, 0.1 ) as $version ) { | |
$version = number_format( $version, 1 ); | |
$data = json_decode( file_get_contents( $data_dir . $version . '.json' ), true ); | |
$groups = wp_list_pluck( $data['groups'], 'data' ); |
This file contains 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
/** Source: https://codepen.io/oaviv/pen/GqXwYp | Author: Ohad **/ | |
body { | |
padding: 50px; | |
background-color: #11151C; | |
color: #7D4E57; | |
line-height: 170%; | |
font-family: sans-serif; | |
} | |
body .container { |
This file contains 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
/** Source: http://codepen.io/MadeByMike/pen/ZOrEmr | Author: Mike (http://codepen.io/MadeByMike) **/ | |
html, body { | |
margin: 0; | |
} | |
header { | |
position: fixed; | |
top: 0; | |
height: 125px; |
This file contains 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 | |
/** | |
* Tests if any of a post's assigned categories are descendants of target categories | |
* | |
* @param int|array $cats The target categories. Integer ID or array of integer IDs | |
* @param int|object $_post The post. Omit to test the current post in the Loop or main query | |
* @return bool True if at least 1 of the post's categories is a descendant of any of the target categories | |
* @see get_term_by() You can get a category by name or slug, then pass ID to this function | |
* @uses get_term_children() Passes $cats | |
* @uses in_category() Passes $_post (can be empty) |