url_to) && is_numeric($redirect->url_to)) ? get_post(intval($redirect->url_to)) : null;
$post_types = get_post_types(array(
'public' => true
), 'objects');
$html = eps_get_type_select($post_types, $current_post);
// Get all the post type select boxes.
foreach ($post_types as $post_type) {
$html .= eps_get_post_type_selects($post_type->name, $current_post);
}
// Get the term select box.
$html .= eps_get_term_archive_select();
// The default input, javascript will populate this input with the final URL for submission.
$html .= 'type) || ((isset($redirect->type) && $redirect->type != 'post')) ? null : ' style="display:none;"') .
'" />
Remember: all external URLs have to start with https://
';
return $html;
}
/**
*
* GET_DESTINATION
*
* This function will output the formatted destination string.
*
* @return html string
* @author WebFactory Ltd
*
*/
function eps_get_destination($redirect = false)
{
if (isset($redirect->url_to)) {
if (is_numeric($redirect->url_to)) {
// This redirect points to a post
if (get_permalink($redirect->url_to)) {
?>
url_to))); ?>ID:
url_to); ?> url_to)); ?>
ID: url_to); ?>
DOES NOT EXIST
URL:url_to)); ?>
Invalid Destination URL';
}
}
/**
*
* GET_TYPE_SELECT
*
* This function will output the available destination types.
*
* @return html string
* @author WebFactory Ltd
*
*/
function eps_get_type_select($post_types, $current_post = false)
{
$html = '';
return $html;
}
/**
*
* GET_POST_TYPE_SELECT
*
* This function will output the available post types.
*
* @return html string
* @author WebFactory Ltd
*
*/
function eps_get_post_type_selects($post_type, $current_post = false)
{
// Start the select.
$html = '';
return $html;
}
/**
*
* GET_TERM_ARCHIVE_SELECT
*
* This function will output a select box with all the taxonomies and terms.
*
* @return html string
* @author WebFactory Ltd
*
*/
function eps_get_term_archive_select()
{
$taxonomies = get_taxonomies('', 'objects');
if (!$taxonomies) return false;
// Start the select.
$html = '';
return $html;
}
function eps_get_ordered_filter($field, $label, $classes = array())
{
global $EPS_Redirects_Plugin;
$nextOrder = 'asc';
$arrow = false;
if (isset($_GET['orderby']) && sanitize_text_field($_GET['orderby']) == $field) {
$arrow = '↓';
if (isset($_GET['order']) && sanitize_text_field($_GET['order']) != 'desc') {
$nextOrder = 'desc';
$arrow = '↑';
}
}
printf(
'%s %s',
esc_attr(implode(' ', $classes)),
esc_url($EPS_Redirects_Plugin->admin_url(array('orderby' => $field, 'order' => $nextOrder))),
esc_attr($label),
esc_attr($arrow)
);
}