1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class Tabify_Edit_Screen_Feature_Plugin_Support { |
4
|
|
|
/** |
5
|
|
|
* Set hooks |
6
|
|
|
* |
7
|
|
|
* @since 0.4.0 |
8
|
|
|
*/ |
9
|
|
|
public function __construct() { |
10
|
|
|
$screen = get_current_screen(); |
|
|
|
|
11
|
|
|
|
12
|
|
|
if ( 'settings_page_tabify-edit-screen' != $screen->base ) { |
13
|
|
|
return; |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'types' ) ); |
17
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'members' ) ); |
18
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'wpml' ) ); |
19
|
|
|
|
20
|
|
|
add_filter( 'wpseo_always_register_metaboxes_on_admin', '__return_true' ); |
21
|
|
|
add_action( 'tabify_add_meta_boxes', array( $this, 'wpseo' ) ); // The old way, will be removed in 1.0 |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Load widgets created by Types |
26
|
|
|
* |
27
|
|
|
* @param string $posttype The posttype the metaboxes should be loaded from |
28
|
|
|
* |
29
|
|
|
* @since 0.4.0 |
30
|
|
|
*/ |
31
|
|
|
public function types( $posttype ) { |
|
|
|
|
32
|
|
|
|
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Load widgets created by WordPress SEO |
37
|
|
|
* |
38
|
|
|
* @since 0.4.0 |
39
|
|
|
*/ |
40
|
|
|
public function wpseo() { |
41
|
|
|
if ( defined( 'WPSEO_PATH' ) && is_file( WPSEO_PATH . 'admin/class-metabox.php' ) ) { |
|
|
|
|
42
|
|
|
include_once WPSEO_PATH . 'admin/class-metabox.php'; |
43
|
|
|
} |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Load widgets created by Members |
49
|
|
|
* |
50
|
|
|
* @since 0.4.0 |
51
|
|
|
*/ |
52
|
|
|
public function members() { |
53
|
|
|
if ( function_exists( 'members_admin_setup' ) && ! did_action( 'load-post.php' ) ) { |
54
|
|
|
do_action( 'load-post.php' ); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Load widgets created by Members |
60
|
|
|
* |
61
|
|
|
* @param string $posttype The posttype the metaboxes should be loaded from |
62
|
|
|
* |
63
|
|
|
* @since 0.7.0 |
64
|
|
|
*/ |
65
|
|
|
public function wpml( $posttype ) { |
66
|
|
|
global $sitepress, $post; |
67
|
|
|
|
68
|
|
|
if ( defined('ICL_SITEPRESS_VERSION') && $sitepress && ! $post ) { |
69
|
|
|
$post = (object) array( 'post_type' => $posttype ); |
70
|
|
|
$sitepress->post_edit_language_options(); |
71
|
|
|
|
72
|
|
|
$post = null; |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
} |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.