Skip to content

Commit 1be0544

Browse files
Merge pull request #277 from codepress/release/4.1.3
Release/4.1.3
2 parents 6268b6f + c4f8a49 commit 1be0544

File tree

6 files changed

+204
-21
lines changed

6 files changed

+204
-21
lines changed

classes/Admin/Page/Columns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(
6060

6161
public function show_read_only_notice( ListScreen $list_screen ) {
6262
if ( $list_screen->is_read_only() ) {
63-
$message = sprintf( __( 'The columns for %s are read only and can therefore not be edited.', 'codepress-admin-columns' ), '<strong>' . esc_html( $list_screen->get_label() ) . '</strong>' );
63+
$message = sprintf( __( 'The columns for %s are read only and can therefore not be edited.', 'codepress-admin-columns' ), '<strong>' . esc_html( $list_screen->get_title() ? $list_screen->get_title() : $list_screen->get_label() ) . '</strong>' );
6464
$message = sprintf( '<p>%s</p>', apply_filters( 'ac/read_only_message', $message, $list_screen ) );
6565

6666
$notice = new Message\InlineMessage( $message );

classes/AdminColumns.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ private function __construct() {
8787
}
8888
}
8989

90-
$this->localize();
91-
9290
add_action( 'init', [ $this, 'install' ], 1000 );
9391
add_action( 'init', [ $this, 'register_global_scripts' ] );
9492
}
@@ -139,12 +137,6 @@ public function register_global_scripts() {
139137
}
140138
}
141139

142-
public function localize() {
143-
$relative_dir = str_replace( WP_PLUGIN_DIR, '', $this->get_dir() );
144-
145-
load_plugin_textdomain( 'codepress-admin-columns', false, $relative_dir . 'languages/' );
146-
}
147-
148140
/**
149141
* @param $file
150142
*

classes/Column/Media/Download.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace AC\Column\Media;
4+
5+
use AC\Column;
6+
7+
class Download extends Column {
8+
9+
public function __construct() {
10+
$this->set_type( 'column-download' )
11+
->set_label( __( 'Download', 'codepress-admin-columns' ) );
12+
}
13+
14+
public function get_raw_value( $id ) {
15+
return wp_get_attachment_url( $id );
16+
}
17+
18+
public function get_value( $id ) {
19+
$url = $this->get_raw_value( $id );
20+
21+
if ( ! $url ) {
22+
return $this->get_empty_char();
23+
}
24+
25+
return sprintf(
26+
'<a class="ac-download cpacicon-download" href="%s" title="%s" download></a>',
27+
$url,
28+
esc_attr( $this->get_label() )
29+
);
30+
}
31+
32+
}

codepress-admin-columns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
Plugin Name: Admin Columns
4-
Version: 4.1.2
4+
Version: 4.1.3
55
Description: Customize columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
66
Author: AdminColumns.com
77
Author URI: https://www.admincolumns.com
@@ -36,7 +36,7 @@
3636
}
3737

3838
define( 'AC_FILE', __FILE__ );
39-
define( 'AC_VERSION', '4.1.2' );
39+
define( 'AC_VERSION', '4.1.3' );
4040

4141
require_once __DIR__ . '/classes/Dependencies.php';
4242

0 commit comments

Comments
 (0)