Skip to content

Commit

Permalink
Merge pull request #275 from codepress/release/4.1.1
Browse files Browse the repository at this point in the history
Release/4.1.1
  • Loading branch information
DGStefan authored Apr 7, 2020
2 parents a4e9630 + a01631d commit b6fff81
Show file tree
Hide file tree
Showing 30 changed files with 1,928 additions and 25 deletions.
2 changes: 1 addition & 1 deletion assets/css/admin-general.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/admin-page-columns.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin-welcome.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/table.css

Large diffs are not rendered by default.

Binary file modified assets/fonts/cpac_icons.eot
Binary file not shown.
Binary file modified assets/fonts/cpac_icons.woff
Binary file not shown.
Binary file modified assets/fonts/cpac_icons.woff2
Binary file not shown.
4 changes: 4 additions & 0 deletions assets/images/addons/metabox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions classes/Integration/MetaBox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace AC\Integration;

use AC\Integration;
use AC\Screen;

final class MetaBox extends Integration {

public function __construct() {
parent::__construct(
'ac-addon-metabox/ac-addon-metabox.php',
__( 'Meta Box', 'codepress-admin-columns' ),
'assets/images/addons/metabox.svg',
__( 'Instantly generate columns for your Meta Box custom fields!', 'codepress-admin-columns' ),
null,
'metabox'
);
}

public function is_plugin_active() {
return class_exists( 'RWMB_Loader', false );
}

public function show_notice( Screen $screen ) {
return $screen->get_id() === 'edit-meta-box';
}

}
1 change: 1 addition & 0 deletions classes/Integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public function __construct() {
new Integration\NinjaForms(),
new Integration\Pods(),
new Integration\Types(),
new Integration\MetaBox(),
new Integration\WooCommerce(),
];

Expand Down
18 changes: 18 additions & 0 deletions classes/ListTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace AC;

/**
* Adapter for the WP List Table
*/
interface ListTable {

/**
* @param string $column
* @param int $id
*
* @return string
*/
public function get_column_value( $column, $id );

}
26 changes: 26 additions & 0 deletions classes/ListTable/Comment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace AC\ListTable;

use AC\ListTable;
use WP_Comments_List_Table;

class Comment implements ListTable {

/**
* @var WP_Comments_List_Table
*/
private $table;

public function __construct( WP_Comments_List_Table $table ) {
$this->table = $table;
}

public function get_column_value( $column, $id ) {
ob_start();
$this->table->column_default( get_comment( $id ), $column );

return ob_get_clean();
}

}
26 changes: 26 additions & 0 deletions classes/ListTable/Post.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace AC\ListTable;

use AC\ListTable;
use WP_Posts_List_Table;

class Post implements ListTable {

/**
* @var WP_Posts_List_Table
*/
private $table;

public function __construct( WP_Posts_List_Table $table ) {
$this->table = $table;
}

public function get_column_value( $column, $id ) {
ob_start();
$this->table->column_default( get_post( $id ), $column );

return ob_get_clean();
}

}
22 changes: 22 additions & 0 deletions classes/ListTable/Taxonomy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace AC\ListTable;

use AC\ListTable;

class Taxonomy implements ListTable {

/**
* @var string
*/
private $taxonomy;

public function __construct( $taxonomy ) {
$this->taxonomy = $taxonomy;
}

public function get_column_value( $column, $id ) {
return apply_filters( "manage_{$this->taxonomy}_custom_column", '', $column, $id );
}

}
Loading

0 comments on commit b6fff81

Please sign in to comment.