PluginProbe
Clicky Analytics / 2.1
Clicky Analytics v2.1
trunk 1.1 1.1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5 1.5.1 1.5.2 1.6 1.6.1 All 40 releases
clicky-analytics / admin / item-reports.php

item-reports.php in Clicky Analytics 2.1, at admin/item-reports.php

58 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Author: Alin Marcu
4 * Author URI: https://deconf.com
5 * Copyright 2013 Alin Marcu
6 * License: GPLv2 or later
7 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8 */
9
10 // Exit if accessed directly
11 if ( ! defined( 'ABSPATH' ) )
12 exit();
13
14 if ( ! class_exists( 'CAWP_Backend_Item_Reports' ) ) {
15
16 final class CAWP_Backend_Item_Reports {
17
18 private $cawp;
19
20 public function __construct() {
21 $this->cawp = CAWP();
22
23 if ( CAWP_Tools::check_roles( $this->cawp->config->options['access_back'] ) && 1 == $this->cawp->config->options['backend_item_reports'] ) {
24 /**
25 * Add custom column in Posts List
26 */
27 add_filter( 'manage_posts_columns', array( $this, 'add_columns' ), 99 );
28 /**
29 * Populate custom column in Posts List
30 */
31 add_action( 'manage_posts_custom_column', array( $this, 'add_icons' ), 99, 2 );
32 /**
33 * Add custom column in Pages List
34 */
35 add_filter( 'manage_pages_columns', array( $this, 'add_columns' ), 99 );
36 /**
37 * Populate custom column in Pages List
38 */
39 add_action( 'manage_pages_custom_column', array( $this, 'add_icons' ), 99, 2 );
40 }
41 }
42
43 public function add_icons( $column, $id ) {
44 global $wp_version;
45
46 if ( 'cawp_stats' != $column ) {
47 return;
48 }
49
50 echo '<a id="cawp-' . $id . '" title="' . get_the_title( $id ) . '" href="#' . $id . '" class="cawp-icon dashicons-before dashicons-chart-line">&nbsp;</a>';
51 }
52
53 public function add_columns( $columns ) {
54 return array_merge( $columns, array( 'cawp_stats' => '<span class="dashicons dashicons-analytics" title="Clicky Analytics"></span>' ) );
55 }
56 }
57 }
58