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 | |
$content = | |
<<<CONTENT | |
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. | |
CONTENT; | |
function columns_and_pages( $content = NULL ) { | |
if ( empty( $content ) ) | |
return $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
<?php | |
$cc_licenses = array( | |
'ccnc' => '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/deed.de"><img alt="Creative Commons Lizenzvertrag" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br />Dieses Werk ist lizenziert unter einer <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/deed.de">Creative Commons Namensnennung-Nicht kommerziell 4.0 International Lizenz</a>.', | |
'ccncsa' => '<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/deed.de"><img alt="Creative Commons Lizenzvertrag" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />Dieses Werk ist lizenziert unter einer <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/deed.de">Creative Commons Namensnennung - Nicht-kommerziell - Weitergabe unter gleichen Bedingungen 4.0 International Lizenz</a>.'; | |
'ccncnd' => '<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/deed.de">< |
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: 000 Tutorial TestFile | |
* Description: Simple testfile for writing tutorials | |
*/ | |
namespace TutorialTestFile; | |
add_action( | |
'plugins_loaded', |
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
<h1>jQuery Testseite</h1> | |
<p id="test">Hello World!</p> | |
<p><a href="#" id="clickit">Click it!</a></p> | |
<script type="text/javascript"> | |
$(document).ready( | |
function() { | |
$('#test').bind( |
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 create_onetime_nonce( $action = -1 ) { | |
$time = time(); | |
$nonce = wp_create_nonce( $time . $action ); | |
set_transient( '_nonce_' . $time, 1, 60*60 ); // adjust the lifetime of the transient | |
return $nonce . '-' . $time; | |
} | |
function verify_onetime_nonce( $_nonce, $action = -1 ) { | |
@list( $nonce, $time ) = explode( '-', $_nonce ); |
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 DataContainer | |
{ | |
public static $data = array(); | |
public function __set( $name, $value ) { | |
self::$data[$name] = $value; | |
} | |
public function __get( $name ) { |
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 wordpress | |
/** | |
* @see http://en.wikipedia.org/wiki/Email_address | |
*/ | |
$email = array(); | |
$email[] = 'john.smith(commentedemail)@example.com'; | |
$email[] = '(commentedemail)[email protected]'; | |
$email[] = 'john.smith@(commentedemail)example.com'; | |
$email[] = '[email protected](commentedemail)'; |
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 File_Upload | |
{ | |
/** | |
* Index key from upload form | |
* @var string | |
*/ | |
public $index_key = ''; | |
/** |
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 | |
/** Display verbose errors */ | |
define( 'IMPORT_DEBUG', false ); | |
// Load Importer API | |
require_once ABSPATH . 'wp-admin/includes/import.php'; | |
if ( ! class_exists( 'WP_Importer' ) ) { | |
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; | |
if ( file_exists( $class_wp_importer ) ) |
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
add_shortcode( | |
'php', | |
function( $atts, $content = null ){ | |
// un-texturize $content | |
$char_codes = array( '‘', '’', '“', '”', '′', '″' ); | |
$replacements = array( "'", "'", '"', '"', "'", '"' ); | |
$content = str_replace( $char_codes, $replacements, $content ); | |
// decode html-entities | |
$content = html_entity_decode( $content ); |
NewerOlder