Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/entry-vi.../inc
File: functions.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Plugin functions.
[2] Fix | Delete
*
[3] Fix | Delete
* @package EntryViews
[4] Fix | Delete
* @version 1.0.0
[5] Fix | Delete
* @author Justin Tadlock <justin@justintadlock.com>
[6] Fix | Delete
* @copyright Copyright (c) 2010 - 2014, Justin Tadlock
[7] Fix | Delete
* @link http://themehybrid.com/plugins/entry-views
[8] Fix | Delete
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Returns the meta key used throughout the plugin for getting/setting the post view count, which is
[13] Fix | Delete
* saved as post metadata. Developers can also filter this via the `ev_meta_key` hook if they need
[14] Fix | Delete
* to alter it to match a meta key that was previously used by another plugin.
[15] Fix | Delete
*
[16] Fix | Delete
* @since 1.0.0
[17] Fix | Delete
* @access public
[18] Fix | Delete
* @return string
[19] Fix | Delete
*/
[20] Fix | Delete
function ev_get_meta_key() {
[21] Fix | Delete
return apply_filters( 'ev_meta_key', 'Views' );
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Sets the post view count of specific post by adding +1 to the total count. This function should only
[26] Fix | Delete
* be used if you want to add an addtional +1 to the count.
[27] Fix | Delete
*
[28] Fix | Delete
* @since 1.0.0
[29] Fix | Delete
* @access public
[30] Fix | Delete
* @param int $post_id
[31] Fix | Delete
* @return void
[32] Fix | Delete
*/
[33] Fix | Delete
function ev_set_post_view_count( $post_id ) {
[34] Fix | Delete
[35] Fix | Delete
/* Get the number of views the post currently has. */
[36] Fix | Delete
$old_views = get_post_meta( $post_id, ev_get_meta_key(), true );
[37] Fix | Delete
[38] Fix | Delete
/* Add +1 to the number of current views. */
[39] Fix | Delete
$new_views = absint( $old_views ) + 1;
[40] Fix | Delete
[41] Fix | Delete
/* Update the view count with the new view count. */
[42] Fix | Delete
update_post_meta( $post_id, ev_get_meta_key(), $new_views, $old_views );
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Gets the view count of a specific post.
[47] Fix | Delete
*
[48] Fix | Delete
* @since 1.0.0
[49] Fix | Delete
* @access public
[50] Fix | Delete
* @param int $post_id
[51] Fix | Delete
* @return int
[52] Fix | Delete
*/
[53] Fix | Delete
function ev_get_post_view_count( $post_id ) {
[54] Fix | Delete
[55] Fix | Delete
/* Get the number of views the post has. */
[56] Fix | Delete
$views = get_post_meta( $post_id, ev_get_meta_key(), true );
[57] Fix | Delete
[58] Fix | Delete
/* Return the view count and make sure it's an integer. */
[59] Fix | Delete
return !empty( $views ) ? number_format_i18n( absint( $views ) ) : 0;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function