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
asn1crypto |
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 get_props( description ) { | |
var users = []; | |
// Cleanup for easier parsing. | |
description = description.toLowerCase().replace( /[\n|, ]fixes(.*)/i, '' ).replace( /(\n|. )see(.*)/i, '' ); | |
// Place enter to fix cases where it otherwise would fail. See changeset 22094 | |
if ( '.' != description.substr(description.length - 1) ) { | |
description += '.'; | |
} |
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 WP_Site_Icon_Creator { | |
private $file; | |
public function __construct() { | |
$this->file = dirname( __FILE__ ) . '/512px_Icon.png'; | |
$this->generate(); | |
} |
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 | |
require_once dirname( dirname( __FILE__ ) ) . '/gp-load.php'; | |
class GP_Script_Remove_Duplicated_Originals extends GP_CLI { | |
var $usage = "<path>"; | |
public function run() { | |
if ( empty( $this->args ) ) { | |
$this->usage(); |
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
- Set default language and all languages to WordPress/Babble | |
- Loop over all posts and load the translations inside post_content to an array | |
- Loop the array and skip the default language. | |
- Babble_Jobs->create_post_jobs( (object) $curren_post, (array) $language_codes ) | |
- You will get post ids back and need to call the next function. | |
- Babble_Post_Public->initialise_translation( $original_post, $lang_code ) | |
- For the behaviour it's best to look at Babble_Jobs->save_job() which is called by the save_post hook | |
- when successful the default language content should become post_content |
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
### Keybase proof | |
I hereby claim: | |
* I am markoheijnen on github. | |
* I am markoheijnen (https://keybase.io/markoheijnen) on keybase. | |
* I have a public key whose fingerprint is AEB9 B624 EABB AAC7 A40B 829E EAF4 86C8 5AE8 04C8 | |
To claim this, I am signing this object: |
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 | |
add_action( 'wp_login', 'wp_destroy_other_sessions' ); |
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 PHP_Ini_Fixes { | |
private $deprecated_options = array( | |
// Can result in issue in different PHP versions | |
'browscap', | |
//PHP 5.4 removed | |
'register_globals', 'register_long_arrays', | |
'magic_quotes_gpc', 'magic_quotes_runtime', 'magic_quotes_sybase', | |
'allow_call_time_pass_reference', |
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 wp_set_error_handler() { | |
if ( defined( 'E_DEPRECATED' ) ) | |
$errcontext = E_WARNING | E_DEPRECATED; | |
else | |
$errcontext = E_WARNING; | |
set_error_handler( function( $errno, $errstr, $errfile ) { | |
if ( 'wp-db.php' !== basename( $errfile ) ) { |
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 My_Elasticsearch { | |
public function __construct() { | |
add_filter( 'elasticsearch_config_facets', array( $this, 'add_facets' ) ); | |
add_filter( 'elasticsearch_config_fields', array( $this, 'add_fields' ) ); | |
add_filter( 'elasticsearch_indexer_map_field', array( $this, 'indexer_map_field' ), 10, 2 ); | |
add_filter( 'elasticsearch_indexer_build_document', array( $this, 'indexer_build_document' ), 10, 2 ); | |
} |
NewerOlder