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 | |
// Plugin Name: Show Custom Fields Data | |
// Description: This plugin adds a metabox and shows all the custom fields names and data | |
// Author: Zenger | |
// Author URI: http://github.com/Zenger/ | |
// Version: 1.0 | |
function scfd_add_meta_box() | |
{ | |
foreach (get_post_types() as $post_type) |
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 | |
global $wpdb; | |
// Insert the original post | |
$original = wp_insert_post($array, true); | |
// Insert the translated post | |
$translated = wp_insert_post($array, true); | |
// Make some updates to both translations |
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 | |
require_once "wp-load.php"; | |
ob_implicit_flush(true); ob_end_flush(); //Instant output woohooo thx ##php | |
include_once( WP_PLUGIN_DIR . '/sitepress-multilingual-cms/inc/wpml-api.php' ); | |
$serv = new wpdb("root", "password", "user", "localhost"); | |
global $wpdb; | |
set_time_limit(0); | |
define("THUMB_PATH", "http://yoursite.com/img/products/%s/thumbs/%s"); |
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 | |
class Utils | |
{ | |
public static function init() | |
{ | |
self::header_cleanup(); | |
} | |
public static function header_cleanup() |
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 | |
/** | |
* @modified: Zenger | |
* Safe Search and Replace on Database with Serialized Data v2.0.1b | |
* | |
* This script is to solve the problem of doing database search and replace when | |
* developers have only gone and used the non-relational concept of serializing | |
* PHP arrays into single database columns. It will search for all matching | |
* data on the database and change it, even if it's within a serialized PHP | |
* array. |
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 | |
class sOption { | |
var $field; | |
public function __construct( $name = 'setting', $label = 'Your Setting', $type = 'text', $screen = 'general' ) | |
{ | |
$this->field->name = $name; | |
$this->field->type = $type; | |
$this->field->screen = $screen; |
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 | |
define('APIKEY', 'your-api-key'); | |
$request = file_get_contents('https://www.googleapis.com/webfonts/v1/webfonts?key='. APIKEY); | |
$fh = fopen('list.txt', 'w'); | |
fwrite($fh, $request); | |
fclose($fh); | |
$content = json_decode($request) ; |
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 | |
class LazyRecursiveMove | |
{ | |
var $files = array(); | |
var $dest = array(); | |
var $from = ""; | |
var $to = ""; | |
function build_move_array( $from , $to, $parent = "" ) |
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 | |
class Envato | |
{ | |
protected static $key = ""; | |
protected static $username = ""; | |
public static function verify( $code ) |
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
// IMPORTANT ! Use "wp_enqueue_media()" to enqueue the media manager | |
/* | |
Usage : | |
Media( jQuery('my-element'), { title: "Select" } , function(img) { | |
// do something with the img (note for multiple is going to be an array!) | |
}); | |
*/ | |
function Media(element, settings, cb) | |
{ | |
this.settings = jQuery.extend({ |