__('Debug', 'permalink-manager'),
'function' => array('class' => 'Permalink_Manager_Debug', 'method' => 'output')
);
return $admin_sections;
}
public function output() {
global $permalink_manager_options, $permalink_manager_uris, $permalink_manager_permastructs, $permalink_manager_redirects, $permalink_manager_external_redirects, $wp_filter;
$debug_section_url = Permalink_Manager_Admin_Functions::get_admin_url('§ion=debug');
$sections_and_fields = apply_filters('permalink_manager_debug_fields', array(
'debug-data' => array(
'section_name' => __('Debug data', 'permalink-manager'),
'fields' => array(
'uris' => array(
'type' => 'textarea',
'description' => sprintf('%s
%s',
__('List of the URIs generated by this plugin.', 'permalink-manager'),
$debug_section_url,
__('Remove all custom permalinks', 'permalink-manager')
),
'label' => __('Array with URIs', 'permalink-manager'),
'input_class' => 'short-textarea widefat',
'value' => ($permalink_manager_uris) ? print_r($permalink_manager_uris, true) : ''
),
'custom-redirects' => array(
'type' => 'textarea',
'description' => sprintf('%s
%s',
__('List of custom redirects set-up by this plugin.', 'permalink-manager'),
$debug_section_url,
__('Remove all custom redirects', 'permalink-manager')
),
'label' => __('Array with redirects', 'permalink-manager'),
'input_class' => 'short-textarea widefat',
'value' => ($permalink_manager_redirects) ? print_r($permalink_manager_redirects, true) : ''
),
'external-redirects' => array(
'type' => 'textarea',
'description' => sprintf('%s
%s',
__('List of external redirects set-up by this plugin.', 'permalink-manager'),
$debug_section_url, __('Remove all external redirects', 'permalink-manager')
),
'label' => __('Array with external redirects', 'permalink-manager'),
'input_class' => 'short-textarea widefat',
'value' => ($permalink_manager_external_redirects) ? print_r(array_filter($permalink_manager_external_redirects), true) : ''
),
'permastructs' => array(
'type' => 'textarea',
'description' => sprintf('%s
%s',
__('List of permastructures set-up by this plugin.', 'permalink-manager'),
$debug_section_url,
__('Remove all permastructures settings', 'permalink-manager')
),
'label' => __('Array with permastructures', 'permalink-manager'),
'input_class' => 'short-textarea widefat',
'value' => ($permalink_manager_permastructs) ? print_r($permalink_manager_permastructs, true) : ''
),
'settings' => array(
'type' => 'textarea',
'description' => sprintf('%s
%s',
__('List of plugin settings.', 'permalink-manager'),
$debug_section_url,
__('Remove all plugin settings', 'permalink-manager')
),
'label' => __('Array with settings used in this plugin.', 'permalink-manager'),
'input_class' => 'short-textarea widefat',
'value' => print_r($permalink_manager_options, true)
)
)
)
));
// Now get the HTML output
$output = '';
foreach($sections_and_fields as $section_id => $section) {
$output .= (isset($section['section_name'])) ? "
{$section['description']}
" : ""; $output .= "