: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Shortcodes for the plgin.
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2010 - 2014, Justin Tadlock
* @link http://themehybrid.com/plugins/entry-views
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
/* Register shortcodes. */
add_action( 'init', 'ev_register_shortcodes' );
* Registers shortcodes for the plugin.
function ev_register_shortcodes() {
add_shortcode( 'entry-views', 'ev_entry_views_shortcode' );
* Gets the number of views a specific post has.
* @param array $attr Attributes for use in the shortcode.
function ev_entry_views_shortcode( $attr = '' ) {
'post_id' => get_the_ID()
$attr = shortcode_atts( $defaults, $attr, 'entry-views' );
return ev_get_post_views( $attr );