From ea43489e5e83df44d96a7bc95f9e49059ddd059c Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sun, 24 Sep 2017 15:07:24 +0300 Subject: [PATCH] MetaBox - if recirculation is disabled globally, hide the this option in the metabox --- inc/class-spotim-metabox.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/class-spotim-metabox.php b/inc/class-spotim-metabox.php index 1612b7a..0b3227d 100644 --- a/inc/class-spotim-metabox.php +++ b/inc/class-spotim-metabox.php @@ -151,7 +151,12 @@ public function render_metabox( $post ) { echo ' '; echo ' '; - echo ' '; + // Check if recirculation is disabled globally + $hide_recirculation = ''; + if ( 'none' === self::$options->get( 'rc_embed_method' ) ) + $hide_recirculation = 'style="display: none;"'; + + echo ' '; echo ' '; echo ' '; echo '