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: Alert Admin on new Post | |
Plugin URI: http://wordpress.stackexchange.com/questions/19040/alert-email-when-any-post-or-page-is-changed | |
Description: Send an email notification to the administrator when a new post is published. | |
Author: TheDeadMedic, transfered by Viktor Dite | |
Version: 1.0 | |
Copyright CC share alike | |
* @param string $new_status |
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 this to yout functions.php file | |
// you may just want to kill all your RSS Feeds, wordpress does provide | |
remove_action('do_feed', 'disable_all_feeds', 1); | |
remove_action('do_feed_rdf', 'disable_all_feeds', 1); | |
remove_action('do_feed_rss', 'disable_all_feeds', 1); | |
remove_action('do_feed_rss2', 'disable_all_feeds', 1); | |
remove_action('do_feed_atom', 'disable_all_feeds', 1); |
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 | |
/** | |
* Send debug code to the Javascript console | |
*/ | |
function debug_to_console($data) { | |
if(is_array($data) || is_object($data)) | |
{ | |
echo("<script> | |
if(console.debug!="undefined"){ | |
console.log('PHP: ".json_encode($data)."'); |
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 | |
/* array_over_get.php */ | |
$image_arr=array("1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg"); | |
$serial_arr=urlencode(base64_encode(serialize($image_arr))); | |
echo '<img src="process_images.php?arr='.$serial_arr.'" alt="stacked image"/>'; | |
?> | |
<?php |
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 base='http://mizine.de'; | |
var url='/image_path_to_test.jpg'; | |
var fallback_url='/image_path_exists_for_fallback_image.jpg'; | |
/** Asynchronous!!! **/ | |
$.get(base+url).done(function(){ | |
$('#any_DOM_id').append('<img id="my_image" src="'+url+'"/>'); | |
}).fail(function(){ | |
$('#any_DOM_id').append('<img id="my_image" src="'+fallback_url+'"/>'); | |
}); |
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
<!DOCTYPE html> | |
<html dir="LTR" lang="de"> | |
<head> | |
<script type="text/javascript"> | |
/** Disable tracking if the opt-out cookie exists. **/ | |
if (document.cookie.indexOf('optOutPlease=true') > -1) { | |
/** Opt-Out Cookie set here, no tracking, no Tagmanager **/ | |
}else{ | |
/** Put your Javascript Google Tag Manager code beneath |
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
// One more cautios way of extracting all input fields at once is: | |
extract( $_POST, EXTR_OVERWRITE, "form_" ); | |
// This way all your input variables will be called $form_foo and $form_bar at least. | |
// Avoid doing that in the global scope - not because global is evil, but because nobody ever cleans up there. | |
// http://goo.gl/3Q5RV | |
// Thanks to Sergej Müller @wpSEO | |
// you know this how you are doing: | |
$username=$_POST["username"]; | |
$age=$_POST["age"]; |
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 | |
/** | |
This Script ist for Offline Conversion Tracking in Google Anylytics | |
Author: Viktor Dite | |
Contact: http://mizine.de | |
Version: v0.2 | |
**/ | |
$uaid = 'UA-XXXXXXX-X'; // Your Analytics UAID |
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
<div class="content"> | |
<p>Lorem Ipsum Anything</p> | |
<script type="text/javascript"> | |
if(window.location.href.match(/arg=testA/)){ | |
document.write('<button name="button">Click me</button>'); | |
}elseif(window.location.href.match(/arg=TestB/)){ | |
document.write('<button name="button">Click me now!</button>'); | |
}else{ | |
document.write('<button name="button">Show me</button>'); | |
} |
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 | |
/** Thanks to Pascal Landau | |
** https://plus.google.com/105523642741376989823/posts | |
**/ | |
$handle = fopen("path/log.log","a"); | |
fwrite($handle, var_export($array_or_object, true)); | |
fclose($handle); | |
?> |
NewerOlder