]> _ Git - couzy.git/blob
27b673905806b96f736652782ab859a76c99c675
[couzy.git] /
1 <?php
2 /**
3  * @package Admin
4  */
5
6 if ( ! defined( 'WPSEO_VERSION' ) ) {
7         header( 'Status: 403 Forbidden' );
8         header( 'HTTP/1.1 403 Forbidden' );
9         exit();
10 }
11
12
13 if ( ! class_exists( 'WPSEO_Bulk_Description_List_Table' ) ) {
14         /**
15          *
16          */
17         class WPSEO_Bulk_Description_List_Table extends WPSEO_Bulk_List_Table {
18
19
20                 /**
21                  * Current type for this class will be (meta) description.
22                  *
23                  * @var string
24                  */
25                 protected $page_type = 'description';
26
27                 /**
28                  * Settings with are used in __construct
29                  *
30                  * @var array
31                  */
32                 protected $settings = array(
33                         'singular' => 'wpseo_bulk_description',
34                         'plural'   => 'wpseo_bulk_descriptions',
35                         'ajax'     => true,
36                 );
37
38                 /**
39                  * The field in the database where meta field is saved.
40                  * @var string
41                  */
42                 protected $target_db_field = 'metadesc';
43
44                 /**
45                  * The columns shown on the table
46                  *
47                  * @return array
48                  */
49                 public function get_columns() {
50                         $columns = array(
51                                 'col_existing_yoast_seo_metadesc' => __( 'Existing Yoast Meta Description', 'wordpress-seo' ),
52                                 'col_new_yoast_seo_metadesc'      => __( 'New Yoast Meta Description', 'wordpress-seo' ),
53                         );
54
55                         return $this->merge_columns( $columns );
56                 }
57
58                 /**
59                  * Parse the metadescription
60                  *
61                  * @param string $column_name
62                  * @param object $record
63                  * @param string $attributes
64                  *
65                  * @return string
66                  */
67                 protected function parse_page_specific_column( $column_name, $record, $attributes ) {
68                         switch ( $column_name ) {
69                                 case 'col_new_yoast_seo_metadesc' :
70                                         return sprintf( '<textarea id="%1$s" name="%1$s" class="wpseo-new-metadesc" data-id="%2$s"></textarea>', 'wpseo-new-metadesc-' . $record->ID, $record->ID );
71                                         break;
72
73
74                                 case 'col_existing_yoast_seo_metadesc':
75                                         echo $this->parse_meta_data_field( $record->ID, $attributes );
76                                         break;
77                         }
78                 }
79
80         } /* End of class */
81 } /* End of class-exists wrapper */