| Server IP : 145.239.37.162 / Your IP : 216.73.216.4 Web Server : Apache System : Linux webm003.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaa ( 38250) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaa/www2024/wp-content/plugins/pop-up-pluginknock/admin/ |
Upload File : |
<?php
class Pop_up_admin
{
public static function display()
{
include plugin_dir_path(__FILE__) . 'pop-up-view-admin.php';
}
public static function save_form()
{
// check form completed
if (!isset($_POST['pop_up_nonce']) || !wp_verify_nonce($_POST['pop_up_nonce'], 'pop_up_save')) {
return;
}
// image save / delete => DELETE NOT WORKING
// if (!empty($_FILES['image']['tmp_name'])) {
// $uploaded_image = $_FILES['image'];
// $upload_overrides = array('test_form' => false);
// $movefile = wp_handle_upload($uploaded_image, $upload_overrides);
// if ($movefile && !isset($movefile['error'])) {
// $image_url = $movefile['url'];
// update_option('image_url', $image_url);
// }
if (isset($_GET['updated'])) {
$message = urldecode($_GET['message']);
echo '<div class="updated"><p>' . $message . '</p></div>';
}
//save datas, define which fields
$fields = ['title', 'text', 'link', 'animation_type', 'animation_duration'];
foreach ($fields as $field) {
if (isset($_POST[$field])) {
update_option($field, sanitize_text_field($_POST[$field]));
}
}
}
}
add_action('admin_init', array('Pop_up_admin', 'save_form'));