PluginProbe ʕ •ᴥ•ʔ
Shortcoder — Create Shortcodes for Anything / 6.3.2
Shortcoder — Create Shortcodes for Anything v6.3.2
trunk 3.0 3.0.1 3.1 3.2 3.3 3.4 3.4.1 4.0 4.0.1 4.0.2 4.0.3 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.3 4.4 4.5 4.6 5.0 5.0.1 5.0.2 5.0.3 5.0.4 5.1 5.2 5.2.1 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.4 5.5 5.6 5.7 5.8 6.0 6.1 6.2 6.3 6.3.1 6.3.2 6.4 6.5 6.5.1 6.5.2 6.5.3
shortcoder / admin / manage.php
shortcoder / admin Last commit date
css 2 years ago font 2 years ago images 2 years ago js 2 years ago admin.php 2 years ago edit.php 2 years ago form.php 2 years ago insert.php 2 years ago manage.php 2 years ago settings.php 2 years ago tools.php 2 years ago
manage.php
70 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 $new_columns = array();
21
22 foreach( $columns as $id => $val ){
23 if( $id == 'taxonomy-sc_tag' ){
24 $new_columns[ 'shortcode' ] = __( 'Shortcode', 'shortcoder');
25 $new_columns[ 'desc' ] = __( 'Description', 'shortcoder');
26 }
27 $new_columns[$id] = $val;
28 }
29
30 return $new_columns;
31
32 }
33
34 public static function column_content( $column, $post_id ){
35
36 $general_settings = Shortcoder::get_settings();
37
38 if( $column == 'shortcode' ){
39 $sc_tag = Shortcoder::get_sc_tag( $post_id );
40 echo '<span class="sc_copy_list_wrap"><input type="text" class="widefat sc_copy_text" readonly value="' . esc_attr( $sc_tag ) . '" /><a href="#" class="sc_copy_list" title="' . esc_attr__( 'Copy', 'shortcoder' ) . '"><span class="dashicons dashicons-clipboard"></span></a></span>';
41 if( $general_settings[ 'list_content' ] != 'no' ){
42 $sc_post = get_post( $post_id );
43 $sc_content = trim( $sc_post->post_content );
44 if( !empty( $sc_content ) ){
45 $content_size = intval( $general_settings[ 'list_content' ] );
46 $sc_content = substr( $sc_content, 0, $content_size ? $content_size : 100 );
47 echo '<pre class="sc_content_list">' . esc_html( trim( $sc_content ) ) . '...</pre>';
48 }
49 }
50 }
51
52 if( $column == 'desc' ){
53 $sc_settings = Shortcoder::get_sc_settings( $post_id );
54 echo esc_html( $sc_settings[ '_sc_description' ] );
55 }
56
57 }
58
59 public static function per_page_count( $count, $post_type ){
60 if( $post_type == SC_POST_TYPE && $count == 20 ){
61 return 500;
62 }
63 return $count;
64 }
65
66 }
67
68 SC_Admin_Manage::init();
69
70 ?>