"wd_isEmpty", "op" => "eq", "val" => false)), "Please enter a valid form name!");
?>
"/>
this documentation for more information about importing your settings from Ajax Search Lite.", 'ajax-search-pro'),
'https://documentation.ajaxsearchpro.com/getting-started/importing-from-the-lite-version',
); ?>
">
getError()) {
if ( !wp_verify_nonce($_POST['asp_new_nonce'], 'asp_new_nonce') ) {
echo "" . __('Failure. Nonce invalid, please reload the page and try again.', 'ajax-search-pro') . "
";
} else {
if (isset($_POST['import'])) {
$id = wd_asp()->instances->importFromLite($_POST['addsearch'], get_current_user_id());
} else {
$id = wd_asp()->instances->add($_POST['addsearch'], get_current_user_id());
}
if ($id !== false) {
wd_asp()->css_manager->generator->generate();
echo "" . __('Search Form Successfuly added!', 'ajax-search-pro') . "
";
} else {
echo "" . __('The search form was not created. Please contact support.', 'ajax-search-pro') . "
";
}
}
}
if (
isset($_POST['instance_new_name'], $_POST['instance_id'], $_POST['asp_name_nonce' . '_' . $_POST['instance_id']])
) {
if ( !wp_verify_nonce($_POST['asp_name_nonce' . '_' . $_POST['instance_id']], 'asp_name_nonce_' . $_POST['instance_id']) ) {
echo "" . __('Failure. Nonce invalid, please reload the page and try again.', 'ajax-search-pro') . "
";
} else {
if ($_POST['instance_new_name'] != ''
&& strlen($_POST['instance_new_name']) > 0
) {
if ( wd_asp()->instances->rename($_POST['instance_new_name'], $_POST['instance_id']) !== false )
echo "" . __('Form name changed!', 'ajax-search-pro') . "
";
else
echo "" . __('Failure. Search could not be renamed.', 'ajax-search-pro') . "
";
} else {
echo "" . __('Failure. Form name must be at least 1 character long', 'ajax-search-pro') . "
";
}
}
}
if ( isset($_POST['instance_copy_id']) ) {
if ($_POST['instance_copy_id'] != '') {
if ( wd_asp()->instances->duplicate($_POST['instance_copy_id']) !== false ) {
wd_asp()->css_manager->generator->generate();
echo "" . __('Form duplicated!', 'ajax-search-pro') . "
";
} else {
echo "" . __('Failure. Search form could not be duplicated.', 'ajax-search-pro') . "
";
}
} else {
echo "" . __('Failure :(', 'ajax-search-pro') . "
";
}
}
?>