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 will copy all terms from country taxonomy to area taxonomy | |
* this will also include the child terms, but will not place them in right hierarchy | |
* for this please check the wp_insert_term() [ https://codex.wordpress.org/Function_Reference/wp_insert_term ] argument in codex and modify the loop | |
* @uses wp_insert_term() | |
* @return boolean | |
*/ | |
function CopyTermsToOtherTaxonomy(){ | |
static $done; |
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
/** | |
* See: https://gist.github.com/1847816 | |
* See: http://stackoverflow.com/questions/736513/how-do-i-parse-a-url-into-hostname-and-path-in-javascript | |
* Parse a URI, returning an object similar to Location | |
* Usage: var uri = parseUri("hello?search#hash") | |
*/ | |
function parseUri(url) { | |
var result = {}; |
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
// ==UserScript== | |
// @name Easy Browse freedownloadbd.com | |
// @namespace http://facebook.com/kudratullah/ | |
// @version 9.80 | |
// @description Script for Easy Category Browsing in freedownloadbd.com | |
// @match *.freedownloadbd.com/* | |
// @include *.freedownloadbd.com/* | |
// @exclude *.freedownloadbd.com/index.php/component/search/* | |
// @require http://code.jquery.com/jquery-2.1.4.min.js | |
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js |
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
<textarea style="width: 100%; height: 299px;" onclick="select();"> | |
<?php | |
$args = array( | |
'post_type' => array( 'post', 'page', 'media', 'news' ), | |
'posts_per_page' => -1, | |
); | |
echo 'Title of page, URL of Page'. PHP_EOL; | |
$dump = new WP_Query($args); | |
if($dump->have_posts()){ | |
while($dump->have_posts()){ |
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
/** | |
* Usage: php makepot.php PROJECT DIRECTORY [OUTPUT] | |
* Generate POT file from the files in DIRECTORY [OUTPUT] | |
* Available projects: generic, wp-frontend, wp-admin, wp-network-admin, wp-core, wp-ms, wp-tz, wp-plugin, wp-theme, bb, mu, bp, glotpress, rosetta, wporg-bb-forums | |
* This is windows cmd command | |
*/ | |
C:\xampp\php>php c:\xampp\htdocs\wpdev\tools\makepot.php wp-plugin c:\xampp\htdocs\wpdev\wp-content\plugins\sp_google_maps c:\lang.pot |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HTML5 Form Attribute</title> | |
</head> | |
<body> | |
<form name="contact-form" method="POST" action="sentmail.php"> | |
<p> | |
<label for="name">Name:</label> | |
<input type="text" id="name" name="name" |
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 | |
// in functions.php | |
add_theme_support( 'post-thumbnails'); | |
/* | |
Wordpress crop an image = 5 size. Sizes are given below | |
thumbnail // Thumbnail (default 150px x 150px max) |
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 | |
/** | |
* Integratin WordPress Plugins into WordPress Theme for automatic download/instgall and activation. | |
* Required TGM Plugin Activation library [http://tgmpluginactivation.com/] | |
* Help Urls-- | |
* http://code.tutsplus.com/tutorials/integrating-the-envato-wordpress-toolkit-to-your-theme-the-plugin--wp-33264 | |
* http://tgmpluginactivation.com/ | |
* https://wordpress.org/support/topic/embed-a-plugin-in-template | |
* http://thomasgriffinmedia.com/blog/2011/09/automatically-install-plugins-with-themes-for-wordpress/ | |
* http://codex.wordpress.org/Function_Reference/is_plugin_active |
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 | |
# the request | |
$file = file_get_contents('http://www.videojs.com/js/video-js.swf'); | |
$file_url = 'http://www.videojs.com/js/video-js.swf'; | |
echo "<br>"; | |
$ch = curl_init($file_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_exec($ch); | |
# get the content type |