Oops! Página Não Encontrada.
Parece que nada foi encontrado neste Local. Talvez tente uma Pesquisa?
stickers_option, []); } private function save_stickers($stickers) { update_option($this->stickers_option, $stickers); } private function get_settings() { return wp_parse_args(get_option($this->settings_option, []), [ "font_size_main" => 19, "font_size_button" => 16, "font_size_sub" => 13, "text_align" => "center", "thumb_max_width" => 100, "thumb_border_radius" => 8 ]); } public function handle_forms() { if (!isset($_POST["ds_nonce"]) || !wp_verify_nonce($_POST["ds_nonce"], "ds_action_nonce") || !current_user_can("manage_options")) return; if (isset($_POST["save_sticker"])) { $stickers = $this->get_stickers(); $id = isset($_POST["sticker_id"]) && !empty($_POST["sticker_id"]) ? intval($_POST["sticker_id"]) : time(); $content_type = sanitize_key($_POST["content_type"]); $sticker_data = [ "id" => $id, "status" => sanitize_key($_POST["status"]), "content_type" => $content_type, "button_text" => sanitize_text_field($_POST["button_text"]), "sub_button_text" => sanitize_text_field($_POST["sub_button_text"]), "button_color" => sanitize_hex_color($_POST["button_color"]), "position" => sanitize_key($_POST["position"]), "trigger_type" => sanitize_key($_POST["trigger_type"]), "trigger_value" => intval($_POST["trigger_value"]), "injection_method" => sanitize_key($_POST["injection_method"]), "injection_ids" => sanitize_text_field(preg_replace("/[^0-9,]/", "", $_POST["injection_ids"])), "show_thumbnail" => isset($_POST["show_thumbnail"]), "enable_ga_event" => isset($_POST["enable_ga_event"]), "utm_source" => sanitize_text_field($_POST["utm_source"]), "utm_medium" => sanitize_text_field($_POST["utm_medium"]), "utm_campaign" => sanitize_text_field($_POST["utm_campaign"]), ]; switch ($content_type) { case "manual": $sticker_data["main_text"] = wp_kses_post($_POST["main_text"] ?? ""); $sticker_data["button_url"] = esc_url_raw($_POST["button_url"] ?? "#"); break; case "random_post": $sticker_data["random_post_cat_id"] = intval($_POST["random_post_cat_id"]); $sticker_data["random_post_days"] = intval($_POST["random_post_days"]); break; case "post_list": $sticker_data["post_list_ids"] = sanitize_text_field(preg_replace("/[^0-9,]/", "", $_POST["post_list_ids"])); break; } $stickers[$id] = $sticker_data; $this->save_stickers($stickers); wp_redirect(admin_url("admin.php?page=dynamic-stickers&message=saved")); exit; } if (isset($_POST["delete_sticker"])) { $stickers = $this->get_stickers(); unset($stickers[intval($_POST["sticker_id"])]); $this->save_stickers($stickers); wp_redirect(admin_url("admin.php?page=dynamic-stickers&message=deleted")); exit; } if (isset($_POST["save_settings"])) { $settings = [ "font_size_main" => intval($_POST["font_size_main"]), "font_size_button" => intval($_POST["font_size_button"]), "font_size_sub" => intval($_POST["font_size_sub"]), "text_align" => sanitize_key($_POST["text_align"]), "thumb_max_width" => intval($_POST["thumb_max_width"]), "thumb_border_radius" => intval($_POST["thumb_border_radius"]), ]; update_option($this->settings_option, $settings); wp_redirect(admin_url("admin.php?page=dynamic-stickers-settings&message=saved")); exit; } } public function render_manage_page() { $stickers = $this->get_stickers(); ?>
Ação concluída com sucesso!
ID / Shortcode | Status | Tipo de Conteúdo | Método de Exibição | Ações |
---|---|---|---|---|
Nenhum sticker criado ainda. | ||||
[dynamic_sticker id="' . esc_attr($id) . '"] '; ?> |
;font-size:20px;vertical-align:middle;">● | Editar |
Configurações salvas!
".get_the_title()."
";$sticker["button_url"]=get_permalink();if($sticker["show_thumbnail"]??false){$sticker["thumbnail_url"]=get_the_post_thumbnail_url(get_the_ID(),"medium_large");}$post_found=true;}wp_reset_postdata(); } }else{$post_found=true;} if($post_found){ if (!empty($sticker["utm_source"])) { $utm_params = [ "utm_source" => $sticker["utm_source"], "utm_medium" => $sticker["utm_medium"], "utm_campaign" => !empty($sticker["utm_campaign"]) ? $sticker["utm_campaign"] : $id, ]; $sticker["button_url"] = add_query_arg($utm_params, $sticker["button_url"]); } $final_stickers[$id]=$sticker; } } if(empty($final_stickers))return; $settings=$this->get_settings(); ?> $s): ?>Parece que nada foi encontrado neste Local. Talvez tente uma Pesquisa?