PluginProbe
Analytics Insights – Google Analytics Dashboard for WordPress / trunk
Analytics Insights – Google Analytics Dashboard for WordPress vtrunk
6.3.6 6.3.7 6.3.8 6.3.9 trunk 5.4.1 5.4.2 5.4.2.1 5.4.3 5.4.4 5.4.5 5.4.6 5.4.7 5.5.2 5.5.3 5.5.4 5.5.5 5.5.6 5.6 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 All 61 releases
analytics-insights / admin / item-reports.php

item-reports.php in Analytics Insights – Google Analytics Dashboard for WordPress trunk, at admin/item-reports.php

49 lines 1.8 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: https://www.gnu.org/licenses/gpl-2.0.html
8 */
9 // Exit if accessed directly
10 if ( ! defined( 'ABSPATH' ) )
11 exit();
12 if ( ! class_exists( 'AIWP_Backend_Item_Reports' ) ) {
13
14 final class AIWP_Backend_Item_Reports {
15
16 private $aiwp;
17
18 public function __construct() {
19 $this->aiwp = AIWP();
20 if ( AIWP_Tools::check_roles( $this->aiwp->config->options['access_back'] ) && 1 == $this->aiwp->config->options['backend_item_reports'] ) {
21 // Add custom column in Posts List
22 add_filter( 'manage_posts_columns', array( $this, 'add_columns' ), 99 );
23 // Populate custom column in Posts List
24 add_action( 'manage_posts_custom_column', array( $this, 'add_icons' ), 99, 2 );
25 // Add custom column in Pages List
26 add_filter( 'manage_pages_columns', array( $this, 'add_columns' ), 99 );
27 // Populate custom column in Pages List
28 add_action( 'manage_pages_custom_column', array( $this, 'add_icons' ), 99, 2 );
29 }
30 }
31
32 public function add_icons( $column, $id ) {
33 global $wp_version;
34 if ( 'aiwp_stats' != $column ) {
35 return;
36 }
37 if ( version_compare( $wp_version, '3.8.0', '>=' ) ) {
38 echo '<a id="aiwp-' . esc_attr( $id ) . '" title="' . get_the_title( $id ) . '" href="#' . esc_attr( $id ) . '" class="aiwp-icon dashicons-before dashicons-chart-line">&nbsp;</a>';
39 } else {
40 echo '<a id="aiwp-' . esc_attr( $id ) . '" title="' . get_the_title( $id ) . '" href="#' . esc_attr( $id ) . '"><img class="aiwp-icon-oldwp" src="' . AIWP_URL . 'admin/images/aiwp-icon.png"</a>';
41 }
42 }
43
44 public function add_columns( $columns ) {
45 return array_merge( $columns, array( 'aiwp_stats' => '<span class="dashicons dashicons-chart-area" title="Analytics Insights"></span>' ) );
46 }
47 }
48 }
49