Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Add Column Header
- * Add in the custom log column header on the main log page in the
- * admin area.
- * @version 1.0
- */
- add_filter( 'mycred_log_column_headers', 'mycred_pro_admin_log_columns', 10, 2 );
- function mycred_pro_admin_log_columns( $columns, $module ) {
- // Only appliable for admin area
- if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! is_admin() ) return $columns;
- // Only applicable for myCRED Log page and not personal log
- if ( isset( $module->args['ctype'] ) && isset( $_GET['page'] ) && $_GET['page'] != $module->args['ctype'] . '_history' )
- $columns['column-ref'] = 'Reference';
- return $columns;
- }
- /**
- * Render Ref Column
- * Renders the result of the reference column.
- * @version 1.0
- */
- add_filter( 'mycred_log_column-ref', 'mycred_pro_custom_log_column', 10, 2 );
- function mycred_pro_custom_log_column( $content, $entry ) {
- $refs = mycred_get_all_references();
- if ( isset( $refs[ $entry->ref ] ) )
- return $refs[ $entry->ref ];
- return $entry->ref;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement