I hereby claim:
- I am schlessera on github.
- I am schlessera (https://keybase.io/schlessera) on keybase.
- I have a public key ASAwZ3hewGFJXOlKo5p5dYD5Q-gmmvQDfsbyTKID3Uo09wo
To claim this, I am signing this object:
<?php | |
/** | |
* Shortcode to display copyright notice with current year | |
* @author Alain Schlesser (alain.schlesser@gmail.com) | |
*/ | |
function as_shortcode_copyright() { | |
// generate output in the form of "(C) 2015 Greatest Blog Ever" | |
$copyright = '© ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
class Plugin | |
{ | |
protected $plugin_root; | |
private $loaded; | |
public function __construct(PluginRoot $plugin_root) | |
{ |
<?php | |
/** | |
* Translatable string with multiple links that can be reordered and renamed | |
* @author Alain Schlesser (alain.schlesser@gmail.com) | |
* | |
* @see http://php.net/manual/function.preg-replace.php | |
* @see http://codex.wordpress.org/Function_Reference/_2 | |
*/ |
# Redirect HTTP to HTTPS, for the main domain as well as all subdomains. | |
# | |
# Example: | |
# http://domain.com/ => https://domain.com/ | |
# http://subdomain.domain.com/ => https://subdomain.domain.com/ | |
# | |
# Make sure you replace "replacewithyourdomain" with your actual root domain! | |
# | |
# @author: Alain Schlesser <alain.schlesser@gmail.com> |
Example code to an answer on StackExchange:
Demonstrates accessing an OOP plugin's object instance and using its methods through:
<?php | |
/** | |
* Example plugin. | |
* | |
* @see http://wordpress.stackexchange.com/questions/220286/what-is-the-best-way-to-instantiate-a-class-of-a-plugin-in-your-wordpress-theme/ | |
* | |
* @wordpress-plugin | |
* Plugin Name: Example plugin. | |
* Description: Accessing a plugin object from a theme. | |
* Version: 0.1.0 |
<?php | |
/* | |
* PHPFeature example usage code | |
*/ | |
// Array of strings to define what features you need. | |
$features = array( 'namespaces', 'traits' ); | |
// Instantiate the PHPFeature library. | |
// When you don't provide a version number as the first argument, |
<?php | |
/** | |
* OrderedInvokeTrait | |
* | |
* @package BrightNucleus_Core | |
* @author Alain Schlesser <alain.schlesser@gmail.com> | |
* @license GPL-2.0+ | |
* @link http://www.brightnucleus.com/ | |
* @copyright 2015 Alain Schlesser, Bright Nucleus | |
*/ |
/* Responsive IFrame example | |
* @author Alain Schlesser <alain.schlesser@gmail.com> | |
/* The wrapper gets resized using padding-bottom with a percentage value. This | |
* way, it's height is always directly dependent on its width */ | |
.iframe-wrapper { | |
/* Necessary so we can position the contained IFrame absolutely */ | |
position: relative; | |