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
/* | |
Author: Hinnerk Altenburg | |
Author URI: http://www.hinnerk-altenburg.de | |
Trademark: 'WP-ImmoMakler' is a registered trademark of Hinnerk Altenburg | |
Copyright: © 2015 Hinnerk Altenburg ([email protected]) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License, version 2, as | |
published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 | |
// set terms | |
wp_set_object_terms( $post_id, $object_types, 'immomakler_object_type', true ); | |
// make terms hierarchial by objektart | |
$term_parent = get_term_by( 'slug', $openimmo_data['objektart'], 'immomakler_object_type' ); | |
$term_child = get_term_by( 'slug', $openimmo_data['objektart_detail'], 'immomakler_object_type' ); | |
delete_option( 'immomakler_object_type_children' ); // workaround for WordPress not updating this option properly |
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
Show hidden characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme", | |
"font_size": 12.0, | |
"trim_trailing_white_space_on_save": true, | |
"ensure_newline_at_eof_on_save": false, | |
"tree_animation_enabled": false, | |
"highlight_line": true, | |
"word_separators": "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?" | |
} |
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_log_http_requests( $response, $args, $url ) { | |
// set your log file location here | |
$logfile = plugin_dir_path( __FILE__ ) . '/http_requests.log'; | |
// parse request and response body to a hash for human readable log output | |
$log_response = $response; | |
if ( isset( $args['body'] ) ) { |
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
sub encode_utf_8 { | |
my $string = @_; | |
my $utf8_encoded = ''; | |
eval { | |
$utf8_encoded = Encode::encode('UTF-8', $string, Encode::FB_CROAK); | |
}; | |
if ($@) { | |
# sanitize malformed UTF-8 | |
$utf8_encoded = ''; |
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
use WWW::Mechanize; | |
my $initial_user_agent = 'Mozilla/5.0 (Linux; U; Android 2.2; de-de; HTC Desire HD 1.18.161.2 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'; | |
my @user_agents = ( | |
'Mozilla/5.0 (Windows; U; Windows NT 6.1; nl; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13', | |
'Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7D11', | |
'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5', | |
); | |
# Set an initial custom header with the contructor |