PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | inc/functions/rules.php +9 -4 2.0.22.6.1 View file →
@@ -46,11 +46,11 @@
46 46
47 47 /**
48 48 * Get the current rule options.
49 49 *
50 - * @param array $defaults Default options.
50 + * @param array<string,mixed> $defaults Default options.
51 51 *
52 - * @return array
52 + * @return array<string,mixed>
53 53 */
54 54 function get_rule_options( $defaults = [] ) {
55 55 $rule = current_rule();
56 56
@@ -61,9 +61,9 @@
61 61
62 62 /**
63 63 * Get the current rule extras.
64 64 *
65 - * @return array
65 + * @return array<string,mixed>
66 66 */
67 67 function get_rule_extras() {
68 68 $rule = current_rule();
69 69
@@ -129,6 +129,11 @@
129 129 * @return boolean
130 130 */
131 131 function is_post_type( $post_type ) {
132 132 global $post;
133 - return is_object( $post ) && ( is_singular( $post_type ) || $post->post_type === $post_type );
133 +
134 + if ( ! is_a( $post, '\WP_Post' ) ) {
135 + return false;
136 + }
137 +
138 + return is_singular( $post_type ) || $post->post_type === $post_type;
134 139 }