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: WordPress Simple Cronjob test | |
Plugin URI: | |
Description: This is a Simple WordPress Cronjob testplugin | |
Version: 1.1 | |
Author: Rene Reimann | |
Author URI: http://www.rene-reimann.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 | |
if ( ! function_exists( 'display_recent_posts' ) ) { | |
function display_recent_posts(){ | |
$latest_posts = new WP_Query( 'posts_per_page=5' ); | |
// The Loop | |
if ( $latest_posts->have_posts() ) : |
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 | |
$adress = 'sample@examples.com'; | |
echo get_masked_mailadress( $adress, 10 ) . "\n"; | |
echo get_masked_mailadress( $adress, 95 ) . "\n"; | |
echo get_masked_mailadress( $adress, 30 ) . "\n"; | |
echo get_masked_mailadress( $adress, 5 ) . "\n"; | |
# Return masked eMail adress | |
# Strip x% from the string length at both parts from a email adress |
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 | |
/* Load project specific wp-conifg.php | |
* | |
* This file is located at /share/wp-config.php and is used as Symlink under /usr/share/wordpress/ | |
*/ | |
$_DOMAIN = explode('.', $_SERVER['SERVER_NAME']); | |
if( count( $_DOMAIN ) == 2 ){ | |
$__DOMAIN[2] = $_DOMAIN[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 | |
class object_class { | |
/** | |
* holds some data | |
* @var object | |
*/ | |
public static $var = 0;; |
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: Add Postcount to Adminmenu | |
Plugin URI: https://gist.github.com/derpixler/6d73b30fee3dcaf6d119 | |
Description: This Plugin adds a count bubble on Post menu | |
Version: 1.0 | |
Author: René Reimann | |
Author URI: http://www.rene-reimann.de | |
License: |
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 some rewrite rules | |
* | |
* @return void | |
*/ | |
function tplapi_add_rewrite_rule(){ | |
add_rewrite_rule( '^tplapi/(.*?)/?$','index.php?tplapi=$matches[1]', 'top' ); | |
} | |
add_action( 'init', 'tplapi_add_rewrite_rule', 0 ); |
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 | |
namespace autoloader; | |
function _autoload( $is_admin = false ){ | |
if( $is_admin == 1 ) | |
$is_admin = 'admin/'; | |
foreach ( glob( self::$plugin_obj->include_path . $is_admin . '*.class.php' ) as $k => $file ) { | |
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 | |
namespace project\core\classes; | |
class awesomelass extends someclass { | |
public function __construct() { | |
print_r('.'); | |
die(); | |
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 | |
/** | |
* Validat the last Modifikation of this File | |
* on modification flush the rewrite rules | |
* | |
* @return void | |
*/ | |
function flush_rules() { |