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 | |
/* | |
Plugin Name: Prevent Category Deletion | |
Plugin URI: http://wordpress.stackexchange.com/q/70758/12615 | |
Description: Prevent deletion of categories. Modify the $undeletable array to suit your setup. Use Category SLUGS. | |
Author: brasofilo | |
Version: 1.0 | |
Author URI: http://wordpress.stackexchange.com/users/12615/brasofilo | |
*/ |
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 | |
/* | |
* | |
* This script will backup your web site by remotely archiving all files on the root FTP directory. | |
* It will work even if your web server is memory limited buy splitting zips in several arhive files it they are too many files. | |
* All zip files will be stored in a directory called temporary which must be writable. | |
* | |
* How to use it: | |
* - Place the script at the root of your FTP. |
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 | |
$estados = array( | |
"AC"=>"Acre", | |
"AL"=>"Alagoas", | |
"AM"=>"Amazonas", | |
"AP"=>"Amapá", | |
"BA"=>"Bahia", | |
"CE"=>"Ceará", | |
"DF"=>"Distrito Federal", | |
"ES"=>"Espírito Santo", |
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 | |
global $wpdb, $wp_locale; | |
$query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts, $wpdb->term_taxonomy, $wpdb->term_relationships | |
WHERE $wpdb->posts.post_status = 'publish' | |
AND $wpdb->posts.post_type = 'post' | |
AND $wpdb->term_taxonomy.term_id = 11 | |
AND $wpdb->posts.ID = $wpdb->term_relationships.object_id | |
AND $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id | |
GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC"; |
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
I use the first | |
—– BEGIN LICENSE —– | |
Michael Barnes | |
Single User License | |
EA7E-821385 | |
8A353C41 872A0D5C DF9B2950 AFF6F667 | |
C458EA6D 8EA3C286 98D1D650 131A97AB | |
AA919AEC EF20E143 B361B1E7 4C8B7F04 |
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 validateEmail(email) { | |
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} | |
emailCaptured = false; | |
(function($) { | |
$("input[type='text']").on('keyup', function (e) { |
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
$jsString = ob_get_contents(); | |
ob_end_clean(); | |
$unescaped = array("'", '"'); | |
$escaped = array("\\x27", "\\x22"); | |
echo str_replace($unescaped, $escaped, $jsString); |
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 | |
namespace App\Http\Requests; | |
use App\Http\Requests\Request; | |
use Illuminate\Contracts\Validation\Validator; | |
class AbstractRequest extends Request | |
{ | |
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 | |
/** | |
* Trait to handle commom function used by DynamicController or anything that needs to access or run query in any Database | |
*/ | |
namespace App\Traits; | |
use Config; | |
use Db; |
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 | |
$handle = fopen ("php://stdin", "r"); | |
function equalizeArray($arr) { | |
$diff = 0; | |
$d = []; | |
foreach($arr as $item) { | |
@$d[$item]++; | |
} | |
OlderNewer