Fix undefined index for metabox render
This commit is contained in:
@ -133,12 +133,12 @@ class CWV3Admin {
|
|||||||
wp_nonce_field( plugin_basename( __FILE__ ), 'cwv3_meta' );
|
wp_nonce_field( plugin_basename( __FILE__ ), 'cwv3_meta' );
|
||||||
$meta_value = get_post_meta( $post->ID, 'cwv3_auth', true );
|
$meta_value = get_post_meta( $post->ID, 'cwv3_auth', true );
|
||||||
$site_wide = get_option( 'cwv3_sitewide' );
|
$site_wide = get_option( 'cwv3_sitewide' );
|
||||||
$disabled = 'enabled' == $site_wide[0] ? true : false;
|
$disabled = isset( $site_wide[0] ) && 'enabled' == $site_wide[0] ? true : false;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<label for="cwv3_auth"><?php _e( 'Use authorization for this content', 'cwv3' ); ?>:</label>
|
<label for="cwv3_auth"><?php _e( 'Use authorization for this content', 'cwv3' ); ?>:</label>
|
||||||
<input type="checkbox" id="cwv3_auth" name="cwv3_auth" <?php checked( 'yes', $meta_value, true ); ?> value="yes" <?php disabled( $disabled ); ?>/><br />
|
<input type="checkbox" id="cwv3_auth" name="cwv3_auth" <?php checked( 'yes', $meta_value, true ); ?> value="yes" <?php disabled( $disabled ); ?>/><br />
|
||||||
<?php if ( 'enabled' == $site_wide[0] ) : ?>
|
<?php if ( $disabled ) : ?>
|
||||||
<p class="description"><?php _e( 'Cannot be changed while site wide option is enabled.', 'cwv3' ); ?></p>
|
<p class="description"><?php _e( 'Cannot be changed while site wide option is enabled.', 'cwv3' ); ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user