public function setting_structure_callback_function($option)
{
$post_type = str_replace('_structure', '', $option);
$pt_object = get_post_type_object($post_type);
$slug = $pt_object->rewrite['slug'];
$with_front = $pt_object->rewrite['with_front'];
$value = CPTP_Util::get_permalink_structure($post_type);
$disabled = false;
if (isset($pt_object->cptp_permalink_structure) and $pt_object->cptp_permalink_structure) {
$disabled = true;
}
if (!$value) {
$value = CPTP_DEFAULT_PERMALINK;
}
global $wp_rewrite;
$front = substr($wp_rewrite->front, 1);
if ($front and $with_front) {
$slug = $front . $slug;
}
echo '<p><code>' . home_url() . '/' . esc_html($slug) . '</code> <input name="' . esc_attr($option) . '" id="' . esc_attr($option) . '" type="text" class="regular-text code ' . $this->disabled_string($disabled) . '" value="' . $value . '" ' . $this->disabled_string($disabled) . ' /></p>';
echo '<p>has_archive: <code>';
echo $pt_object->has_archive ? 'true' : 'false';
echo '</code> / ';
echo 'with_front: <code>';
echo $pt_object->rewrite['with_front'] ? 'true' : 'false';
echo '</code></p>';
}