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 | |
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 | |
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 | |
// 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 | |
class Template { | |
static $escape = true; | |
static $template = ""; | |
static $vars = array(); | |
public static function sanitize($what) | |
{ | |
return filter_var($what, FILTER_SANITIZE_STRING); |
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 Request { | |
public $curl_object; | |
public function __construct($p_username = "", $p_password = "", $p_timeout = 15) | |
{ | |
$this->curl_object = curl_init(); | |
curl_setopt($this->curl_object, CURLOPT_HTTPHEADER, Array("Accept: application/json", "Content-Type: application/json")); | |
curl_setopt($this->curl_object, CURLOPT_CONNECTTIMEOUT, $p_timeout); |
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 | |
/** | |
* Slugger, simple logging class | |
* Writes logs into a file and sends them by e-mail once in a while | |
* Written for pure example | |
* @require PHP >= 5.3 | |
* @todo : Fix bug when the class is firt time instantiated it send an empty message | |
*/ | |
/* Don't forget to setup a date default timezone */ |
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 | |
//https://raw.github.com/dongsheng/cURL/master/curl.class.php | |
require_once('curl_class.php'); | |
$request = array( | |
'blog_id' => 1, | |
'username' => 'username', | |
'password' => 'password', | |
'post_id' => 84 |
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
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
# ========= EDIT HERE ====================================================== | |
config = { | |
# Set the save path | |
'save_path' : "C:\\VertrigoServ\\www", | |
'folder_name' : 'dezvoltare', | |
'title' : 'Dezvoltare', |
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 | |
/* | |
Place this script inside the wp-content folder. | |
Any incoming request for image will be taken over if the requested file doesn't exist. | |
And will setup a .htacces file to take all incoming requests and send them to this file. | |
Run it once to setup. | |
Configure the constants below. | |
*/ | |
/* Setup Constants */ |