1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class Tabify_Edit_Screen_Feature_Plugin_Support { |
4
|
|
|
|
5
|
|
|
public function __construct() { |
6
|
|
|
$screen = get_current_screen(); |
|
|
|
|
7
|
|
|
|
8
|
|
|
if ( 'settings_page_tabify-edit-screen' != $screen->base ) { |
9
|
|
|
return; |
10
|
|
|
} |
11
|
|
|
|
12
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'types' ) ); |
|
|
|
|
13
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'members' ) ); |
14
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'wpml' ) ); |
15
|
|
|
|
16
|
|
|
add_filter( 'wpseo_always_register_metaboxes_on_admin', '__return_true' ); |
|
|
|
|
17
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'wpseo' ) ); // The old way, will be removed in 1.0 |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Load widgets created by Types |
22
|
|
|
* |
23
|
|
|
* @param string $posttype The posttype the metaboxes should be loaded from |
24
|
|
|
* |
25
|
|
|
* @since 0.4.0 |
26
|
|
|
*/ |
27
|
|
|
public function types( $posttype ) { |
|
|
|
|
28
|
|
|
|
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Load widgets created by WordPress SEO |
33
|
|
|
* |
34
|
|
|
* @since 0.4.0 |
35
|
|
|
*/ |
36
|
|
|
public function wpseo() { |
37
|
|
|
if ( defined( 'WPSEO_PATH' ) && is_file( WPSEO_PATH . 'admin/class-metabox.php' ) ) { |
|
|
|
|
38
|
|
|
include_once WPSEO_PATH . 'admin/class-metabox.php'; |
39
|
|
|
} |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Load widgets created by Members |
45
|
|
|
* |
46
|
|
|
* @since 0.4.0 |
47
|
|
|
*/ |
48
|
|
|
public function members() { |
49
|
|
|
if ( function_exists( 'members_admin_setup' ) && ! did_action( 'load-post.php' ) ) { |
|
|
|
|
50
|
|
|
do_action( 'load-post.php' ); |
|
|
|
|
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Load widgets created by Members |
56
|
|
|
* |
57
|
|
|
* @param string $posttype The posttype the metaboxes should be loaded from |
58
|
|
|
* |
59
|
|
|
* @since 0.7.0 |
60
|
|
|
*/ |
61
|
|
|
public function wpml( $posttype ) { |
62
|
|
|
global $sitepress, $post; |
63
|
|
|
|
64
|
|
|
if ( defined('ICL_SITEPRESS_VERSION') && $sitepress && ! $post ) { |
65
|
|
|
$post = (object) array( 'post_type' => $posttype ); |
66
|
|
|
$sitepress->post_edit_language_options(); |
67
|
|
|
|
68
|
|
|
$post = null; |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
} |