TwitterImage.php
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace ACA\YoastSeo\Column\Post;
use AC;
use ACA\YoastSeo\Editing;
use ACA\YoastSeo\Export;
use ACA\YoastSeo\Search;
use ACP;
class TwitterImage extends AC\Column\Meta
implements ACP\Editing\Editable, ACP\Search\Searchable, ACP\Export\Exportable {
public function __construct() {
$this->set_group( 'yoast-seo' )
->set_label( __( 'Twitter Image', 'codepress-admin-columns' ) )
->set_type( 'column-yoast_twitter_image' );
}
private function get_meta_key_id() {
return '_yoast_wpseo_twitter-image-id';
}
private function get_meta_key_url() {
return '_yoast_wpseo_twitter-image';
}
public function get_meta_key() {
return '_yoast_wpseo_twitter-image-id';
}
protected function register_settings() {
parent::register_settings();
$this->add_setting( new AC\Settings\Column\Image( $this ) );
}
public function editing() {
return new ACP\Editing\Service\Basic(
( new ACP\Editing\View\Image() )->set_clear_button( true ),
new Editing\Storage\Post\SocialImage( $this->get_meta_key_id(), $this->get_meta_key_url() )
);
}
public function search() {
return new ACP\Search\Comparison\Meta\Image( $this->get_meta_key(), 'post' );
}
public function export() {
return new ACP\Export\Model\Post\Meta( $this->get_meta_key_url() );
}
}