Skip to content

Commit 40d4cf0

Browse files
authored
Merge pull request #252 from codepress/release/3.4.7
Release/3.4.7
2 parents 2be6684 + a2f9ad5 commit 40d4cf0

File tree

16 files changed

+270
-382
lines changed

16 files changed

+270
-382
lines changed

assets/css/ac-jquery-ui.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/table.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/admin-page-columns.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/select2.js

Lines changed: 1 addition & 325 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/table.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Column/Taxonomy.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public function get_value( $post_id ) {
2828
return $this->get_empty_char();
2929
}
3030

31-
return ac_helper()->string->enumeration_list( $terms, 'and' );
31+
$setting_limit = $this->get_setting( 'number_of_items' );
32+
33+
return ac_helper()->html->more( $terms, $setting_limit ? $setting_limit->get_value() : false );
3234
}
3335

3436
/**
@@ -48,6 +50,7 @@ public function get_raw_value( $post_id ) {
4850

4951
public function register_settings() {
5052
$this->add_setting( new Settings\Column\Taxonomy( $this ) );
53+
$this->add_setting( new Settings\Column\NumberOfItems( $this ) );
5154
}
5255

5356
}

classes/Helper/Html.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Html {
1010
* @param string $key
1111
* @param string $value
1212
*
13-
* @since 3.0
1413
* @return string
14+
* @since 3.0
1515
*/
1616
public function get_attribute_as_string( $key, $value ) {
1717
return sprintf( '%s="%s"', $key, esc_attr( trim( $value ) ) );
@@ -20,8 +20,8 @@ public function get_attribute_as_string( $key, $value ) {
2020
/**
2121
* @param array $attributes
2222
*
23-
* @since 3.0
2423
* @return string
24+
* @since 3.0
2525
*/
2626
public function get_attributes_as_string( array $attributes ) {
2727
$output = array();
@@ -390,24 +390,22 @@ public function progress_bar( $args = array() ) {
390390
}
391391

392392
public function more( $array, $number = 10, $glue = ', ' ) {
393+
if ( ! $number ) {
394+
return implode( $glue, $array );
395+
}
396+
393397
$first_set = array_slice( $array, 0, $number );
394398
$last_set = array_slice( $array, $number );
395399

396400
ob_start();
397401

398402
if ( $first_set ) {
403+
$first = sprintf( '<span class="ac-show-more__part -first">%s</span>', implode( $glue, $first_set ) );
404+
$more = $last_set ? sprintf( '<span class="ac-show-more__part -more">%s%s</span>', $glue, implode( $glue, $last_set ) ) : '';
405+
$content = sprintf('<span class="ac-show-more__content">%s%s</span>', $first, $more );
406+
$toggler = $last_set ? sprintf( '<span class="ac-show-more__divider">|</span><a class="ac-show-more__toggle" data-show-more-toggle data-more="%1$s" data-less="%2$s">%1$s</a>', sprintf( __( '%s more', 'codepress-admin-columns' ), count( $last_set ) ), strtolower( __( 'Hide', 'codepress-admin-columns' ) ) ) : '';
399407

400-
echo implode( $glue, $first_set );
401-
402-
if ( $last_set ) { ?>
403-
<span class="ac-more-link-show">( <a><?php printf( __( 'Show %s more', 'codepress-admin-columns' ), count( $last_set ) ); ?></a> )</span>
404-
<span class="ac-show-more-block">
405-
<?php echo $glue . implode( $glue, $first_set ); ?>
406-
<br/>
407-
<span class="ac-more-link-hide">( <a><?php _e( 'Hide', 'codepress-admin-columns' ); ?></a> )</span>
408-
</span>
409-
<?php
410-
}
408+
echo sprintf( '<span class="ac-show-more">%s</span>', $content . $toggler );
411409
}
412410

413411
return ob_get_clean();

classes/Settings/Column/DateTimeFormat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function get_date_options() {
111111
$custom_label = $this->get_html_label(
112112
__( 'Custom:', 'codepress-admin-columns' ),
113113
'',
114-
sprintf( __( 'Learn more about %s.', 'codepress-admin-columns' ), ac_helper()->html->link( 'http://codex.wordpress.org/Formatting_Date_and_Time', __( 'date and time formatting', 'codepress-admin-columns' ) ), array( 'target' => '_blank' ) )
114+
sprintf( __( 'Learn more about %s.', 'codepress-admin-columns' ), ac_helper()->html->link( 'https://wordpress.org/support/article/formatting-date-and-time/', __( 'date and time formatting', 'codepress-admin-columns' ), array( 'target' => '_blank' ) ) )
115115
);
116116

117117
$custom_label .= '<input type="text" class="ac-setting-input-date__custom" value="' . esc_attr( $this->get_date_format() ) . '" disabled>';

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: 3.4.6
4+
Version: 3.4.7
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', '3.4.6' );
39+
define( 'AC_VERSION', '3.4.7' );
4040

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

languages/codepress-admin-columns.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ msgstr ""
155155
msgid "Taxonomy"
156156
msgstr ""
157157

158-
#: classes/Helper/Html.php:403
159-
msgid "Show %s more"
158+
#: classes/Helper/Html.php:406
159+
msgid "%s more"
160160
msgstr ""
161161

162-
#: classes/Helper/Html.php:407
162+
#: classes/Helper/Html.php:406
163163
msgid "Hide"
164164
msgstr ""
165165

0 commit comments

Comments
 (0)