Sorry for not spotting this earlier, I forgot to subscribe to notifications for this plugin.
Thanks for reporting the issue, submitting an updated version now.
Hey no problem I didn’t ethier so I never saw your reply until now.
Here’s two more to add that both occur on the admin page:
Undefined index: php @ class-tha-hooks-interface-admin.php on line 394
Undefined index: shortcode @ class-tha-hooks-interface-admin.php on line 402
Just added two more variables for the checked parameters and if they weren’t set then returned empty. Probably a cleaner way to write it, but it seems to fix it:
public function field_cb( $args ) {
$hooks_group = $args[0];
$hook_name = $args[1];
$hook_description = $args[2];
$output_field_name = 'tha_hooks_interface_' . $hooks_group . '[' . $hook_name . '][output]';
$php_field_name = 'tha_hooks_interface_' . $hooks_group . '[' . $hook_name . '][php]';
$shortcode_field_name = 'tha_hooks_interface_' . $hooks_group . '[' . $hook_name . '][shortcode]';
$tha_interface_settings = get_option( 'tha_hooks_interface_' . $hooks_group );
$shortcode_checked = isset( $tha_interface_settings[ $hook_name ]['shortcode'] ) ? $tha_interface_settings[ $hook_name ]['shortcode'] : '';
$php_checked = isset( $tha_interface_settings[ $hook_name ]['php'] ) ? $tha_interface_settings[ $hook_name ]['php'] : '';
?>
<p><?php echo $hook_description; ?></p>
<p>
<textarea style="font-family:monospace" rows="10" class="widefat" name="<?php echo $output_field_name; ?>" id="<?php echo $output_field_name; ?>"><?php echo htmlentities( $tha_interface_settings[ $hook_name ]['output'], ENT_QUOTES, 'UTF-8' ); ?></textarea>
</p>
<?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
<p>
<label for="<?php echo $php_field_name; ?>">
<input type="checkbox" name="<?php echo $php_field_name; ?>" id="<?php echo $php_field_name; ?>" value="1" <?php checked( $php_checked, 1 ); ?>/>
<?php _e( 'Execute PHP in this hook (must be enclodes in opening and closing PHP tags)', $this->plugin_slug ); ?>
</label>
</p>
<?php endif; ?>
<p>
<label for="<?php echo $shortcode_field_name; ?>">
<input type="checkbox" name="<?php echo $shortcode_field_name; ?>" id="<?php echo $shortcode_field_name; ?>" value="1" <?php checked( $shortcode_checked, 1 ); ?> />
<?php _e( 'Run shortcodes in this hook', $this->plugin_slug ); ?>
</label>
</p>
<?php }
All good in 1.1, thank you!