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
<?php | |
namespace ShowMemberSince; | |
add_action( 'plugins_loaded', 'ShowMemberSince\init' ); | |
/** | |
* Adding needed action hooks | |
*/ | |
function init(){ |
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 to check the environment (WordPress-, PHP and MySQL-version) | |
* Test only on minimum or equal version | |
* | |
* @author Ralf Albert | |
* @version 1.0 | |
* @link https://gist.github.com/1593410 | |
* @license GPL |
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: User Activity | |
Plugin URI: | |
Description: Provides means to query users by last login activity. | |
Version: 1.0 | |
Author: Eric Teubert, Ralf Albert | |
Author URI: ericteubert@googlemail.com, neun12@googlemail.com | |
License: MIT | |
*/ |
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 ); |
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 | |
/* | |
* Since PHP5 there is no need to pass an reference of $this | |
* | |
* @see http://php.net/manual/en/language.oop5.references.php | |
* [...] As of PHP 5, an object variable doesn't contain the object itself as value anymore [...] | |
*/ | |
add_action( 'load-upload.php', array( $this, 'custom_bulk_action' ) ); | |
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 | |
/** | |
* WordPress-Plugin Simple Facebook Avatar | |
* | |
* PHP version 5.3 | |
* | |
* @category PHP | |
* @package WordPress | |
* @subpackage Simple Facebook Avatar | |
* @author Ralf Albert <me@neun12.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: Custom Importer | |
Plugin URI: | |
Description: Import posts or not | |
Author: Ralf Albert | |
Author URI: http://yoda.neun12.de | |
Version: 0.1 | |
Text Domain: custom-importer | |
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
NewerOlder