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 resize_image($filename,$newwidth,$newheight) { | |
list($width, $height) = getimagesize($filename); | |
if(pathinfo($filename,PATHINFO_EXTENSION) == "jpg" || pathinfo($filename,PATHINFO_EXTENSION) == "jpeg") { | |
$src = imagecreatefromjpeg($filename); | |
$dst = imagecreatetruecolor($newwidth, $newheight); | |
imagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); | |
imagejpeg($dst, $filename, 100); | |
} | |
if(pathinfo($filename,PATHINFO_EXTENSION) == "png") { |
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 timeago($datetime, $full = false) { | |
date_default_timezone_set("Asia/Manila"); | |
$now = new DateTime; | |
$ago = new DateTime($datetime); | |
$diff = $now->diff($ago); | |
$diff->w = floor($diff->d / 7); | |
$diff->d -= $diff->w * 7; | |
$string = array( |
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: CRUD Operations | |
Plugin URI: https://www.davidangulo.xyz/portfolio/ | |
Description: A simple plugin that allows you to perform Create (INSERT), Read (SELECT), Update and Delete operations. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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: Simple Contact Form | |
Plugin URI: https://www.davidangulo.xyz/portfolio/ | |
Description: A very simple contact form. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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: Create database table | |
Plugin URI: https://www.davidangulo.xyz/portfolio/ | |
Description: A simple WordPress plugin that creates a database table on activation. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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: Custom Column Plugin Example | |
Plugin URI: https://www.davidangulo.xyz/portfolio/ | |
Description: Add a custom column on WordPress posts. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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: Dashboard Widget Example | |
Plugin URI: https://www.davidangulo.xyz/portfolio/ | |
Description: Just another WordPress plugin with dashboard widget. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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: Wordpress plugin with settings | |
Plugin URI: wordpress.org/plugins | |
Description: Just another WordPress plugin with settings page. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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: My cron WordPress plugin | |
Plugin URI: wordpress.org/plugins | |
Description: A simple WordPress plugin that executes many times in a certain interval. | |
Version: 1.0.0 | |
Author: David Angulo | |
Author URI: https://www.davidangulo.xyz/ | |
License: GPL2 | |
*/ |
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 | |
/** | |
* Class to check up e-mail | |
* | |
* @author Konstantin Granin <kostya@granin.me> | |
* @copyright Copyright (c) 2015, Konstantin Granin | |
*/ | |
class verifyEmail { |