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 | |
$json = '[{"key":"group_5533906b7cb6f","title":"Kirja-arviot","fields":[{"key":"field_54f96fb0b6afd","label":"Kirjan nimi","name":"kirja-nimi","type":"text","instructions":"","required":0,"conditional_logic":0,"wrapper":{"width":"","class":"","id":""},"default_value":"","placeholder":"","prepend":"","append":"","formatting":"html","maxlength":"","readonly":0,"disabled":0},{"key":"field_54f97431afa89","label":"Kirjan kuva","name":"kirja-kuva","type":"image","instructions":"","required":0,"conditional_logic":0,"wrapper":{"width":"","class":"","id":""},"preview_size":"thumbnail","library":"all","return_format":"array","min_width":0,"min_height":0,"min_size":0,"max_width":0,"max_height":0,"max_size":0,"mime_types":""},{"key":"field_54f9728eb6b00","label":"Kirjan tiedot","name":"kirja-tiedot","type":"repeater","instructions":"Esimerkiksi julkaisija, kirjan kuvaus tai julkaisuvuosi.","required":0,"conditional_logic":0,"wrapper":{"width":"","class":"","id":""},"row_min":"","row_limit":"","layout":"table","but |
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
// pipe script output to this script: | |
// ./wpscan --url=http://site.fi | php wp_check_for_vulnerabilities.php | |
$error = false; | |
while(!feof(STDIN)){ | |
$line = fgets(STDIN); | |
if(strpos($line,"[!]")){ | |
echo $line; | |
$error = true; |
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 | |
$dryRun = true; | |
$posts = get_posts(array("post_type" => (!empty($_GET['type']) ? $_GET['type'] : 'post'), "posts_per_page" => -1)); // post_type is kinda reserved. | |
foreach($posts as $post){ | |
$id = $post->ID; | |
if(has_post_thumbnail($id)){ | |
continue; |
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: Remove accents from files on upload | |
* Plugin URI: https://gist.github.com/onnimonni/d58bdcff44f8208a15c7 | |
* Description: Sanitize accents from Cyrillic, German, French, Polish, Spanish, Hungarian, Czech, Greek, Swedish during upload. Also fix OS-X NFD filenames. | |
* Version: 1.0 | |
* Author: Onni Hakala | |
* Author URI: http://github.com/onnimonni | |
* License: GPLv3 | |
*/ |
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 () { | |
"use strict"; | |
// ES6 Magic, powered by Babel. | |
if (document.body.classList.contains("bbpress")) { | |
var replies = document.querySelectorAll(".reply"); | |
for (var i = 0; i < replies.length; i++) { |
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
var fs = require("fs"); | |
var mysql = require("mysql"); | |
var async = require("async"); | |
var filename = process.argv[2]; | |
// NOTE: This is shaped to a very spesific format of json, you have to adjust each function to suit your format. | |
var db = mysql.createConnection({ | |
host: "localhost", | |
user: "user", |
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; | |
$threads = $wpdb->get_results("SELECT ID, post_title, post_name FROM wp_posts WHERE post_type = 'topic'"); | |
foreach($threads as $thread){ | |
$sanitized_title = sanitize_title($thread->post_title); | |
$id = $thread->ID; | |
$wpdb->query("UPDATE wp_posts SET post_name = '$sanitized_title' WHERE ID = $id"); |
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 rnb { | |
function __construct() { | |
// nothing here. | |
} | |
// insert loads of functions here |
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
export function request(options = {}){ | |
// Usage: | |
// request({ | |
// url: "example.com", | |
// data: document.querySelector("form"), //FormData-object or form element | |
// method: "POST", | |
// headers: {key: "value"}, | |
// success: function(response, status){}, | |
// error: function(error, status){}, |
OlderNewer