WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics Dashboard
Post analytic results spill into custom column (2 posts)

  1. blindmikey
    Member
    Posted 1 year ago #

    See screenshot: http://dl.dropbox.com/u/1687739/error.png

    PHP that registers my own column (in functions.php):

    add_filter("manage_projects_posts_columns", "project_edit_columns");
    add_action("manage_projects_posts_custom_column", "project_custom_columns");
    
    function project_edit_columns( $columns ) {
    
    	// Add the extra column for product categories instead of rebuilding the whole array
    	$columns["client"] = "For Client";
    
    	return $columns;
    }
    
    function project_custom_columns( $column ) {
    	global $post;
    	switch( $column ) {
    		case "client":
    			echo get_the_title(get_post_meta($post->ID, '_cs_client', true));
    		break;
    	}
    }

    http://wordpress.org/extend/plugins/google-analytics-dashboard/

  2. Manuel Freund
    Member
    Posted 1 year ago #

    Just discovered the same problem. Changing line 144 in the "posts_pages_custom_column"-function (file "gad-admin-pages-posts.php") seems to do the trick:

    function posts_pages_custom_column($column_name, $post_id)
      {
    //    if(($value = $this->security_check()) !== true )
        if((($value = $this->security_check()) !== true ) && ($column_name == 'analytics'))
        {
          echo $value;
        }
        else
        {
          if( $column_name == 'analytics' )
          {
            echo '<div id="gad_ppp_' . $post_id . '" class="gad_ppp_loading"><p class="widget-loading hide-if-no-js">Loading…</p><p class="describe hide-if-js">This widget requires JavaScript.</p></div>';
          }
        }
      }

    Now if you want the analytics-graph to appear in your custom columns you'll have to add it yourself:

    function project_edit_columns( $columns ) {
    
    	// Add the extra column for product categories instead of rebuilding the whole array
    	$columns["client"] = "For Client";
    	$columns["analytics"] = __("Analytics");
    
    	return $columns;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic