css
4 years ago
font
4 years ago
images
4 years ago
js
4 years ago
admin.php
4 years ago
edit.php
4 years ago
form.php
4 years ago
insert.php
4 years ago
manage.php
4 years ago
settings.php
4 years ago
tools.php
4 years ago
manage.php
46 lines
| 1 | <?php |
| 2 | if( ! defined( 'ABSPATH' ) ) exit; |
| 3 | |
| 4 | class SC_Admin_Manage{ |
| 5 | |
| 6 | public static function init(){ |
| 7 | |
| 8 | add_filter( 'manage_' . SC_POST_TYPE . '_posts_columns', array( __CLASS__, 'column_head' ) ); |
| 9 | |
| 10 | add_action( 'manage_' . SC_POST_TYPE . '_posts_custom_column', array( __CLASS__, 'column_content' ), 10, 2 ); |
| 11 | |
| 12 | add_filter( 'edit_posts_per_page', array( __CLASS__, 'per_page_count' ), 10, 2 ); |
| 13 | |
| 14 | } |
| 15 | |
| 16 | public static function column_head( $columns ){ |
| 17 | |
| 18 | unset( $columns[ 'views' ] ); |
| 19 | |
| 20 | $columns[ 'shortcode' ] = __( 'Shortcode', 'sc'); |
| 21 | |
| 22 | return $columns; |
| 23 | |
| 24 | } |
| 25 | |
| 26 | public static function column_content( $column, $post_id ){ |
| 27 | |
| 28 | if( $column == 'shortcode' ){ |
| 29 | $sc_tag = Shortcoder::get_sc_tag( $post_id ); |
| 30 | echo '<code>' . $sc_tag . '</code>'; |
| 31 | } |
| 32 | |
| 33 | } |
| 34 | |
| 35 | public static function per_page_count( $count, $post_type ){ |
| 36 | if( $post_type == SC_POST_TYPE && $count == 20 ){ |
| 37 | return 500; |
| 38 | } |
| 39 | return $count; |
| 40 | } |
| 41 | |
| 42 | } |
| 43 | |
| 44 | SC_Admin_Manage::init(); |
| 45 | |
| 46 | ?> |