{"id":12628,"date":"2026-11-15T02:04:03","date_gmt":"2026-11-15T02:04:03","guid":{"rendered":"https:\/\/zaferinadigital.com\/mtekno\/?page_id=12628"},"modified":"2026-11-15T02:04:03","modified_gmt":"2026-11-15T02:04:03","slug":"bookmark","status":"publish","type":"page","link":"https:\/\/theme.co.id\/installer\/bookmark\/","title":{"rendered":"Bookmark"},"content":{"rendered":"    <div id=\"gp-saved-posts-container\"><p style=\"font-size:13px;\">Loading Article ...<\/p><\/div>\n    \n    <template id=\"gp-empty-state-template\">\n        <div class=\"gp-empty-state\">\n            <p>Yahh, keranjang artikelmu masih kosong nih. Jelajahi category blog kami<\/p>\n            <div class=\"gp-empty-categories\" style=\"margin-top:20px;\"><ul><li><a href=\"https:\/\/theme.co.id\/installer\/category\/book\/\">Book<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/premier-league\/\">EPL<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/europe\/\">Europe<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/fashion\/\">Fashion<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/film\/\">Film<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/food\/\">Food<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/football\/\">Football<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/health-fitness\/\">Health &amp; Fitness<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/eaurope-champion-league\/\">League<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/music\/\">Music<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/nfl\/\">NFL<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/science\/\">Science<\/a><\/li><li><a href=\"https:\/\/theme.co.id\/installer\/category\/uncategorized\/\">Uncategorized<\/a><\/li><\/ul><\/div>        <\/div>\n    <\/template>\n    <script>\n    document.addEventListener(\"DOMContentLoaded\", function() {\n        const container = document.getElementById(\"gp-saved-posts-container\");\n        const emptyTemplate = document.getElementById(\"gp-empty-state-template\");\n        if (!container || !emptyTemplate) return;\n\n        const emptyHtml = emptyTemplate.innerHTML;\n        let currentPage = 1;\n\n        function loadSavedPosts(page = 1) {\n            let saved = JSON.parse(localStorage.getItem(\"gp_saved_posts\")) || [];\n            let savedDates = JSON.parse(localStorage.getItem(\"gp_saved_dates\")) || {};\n            \n            if (!saved.length) { \n                container.innerHTML = emptyHtml; \n                return; \n            }\n\n            const fd = new FormData();\n            fd.append('action', 'gp_get_saved_posts');\n            fd.append('paged', page);\n            fd.append('saved_dates', JSON.stringify(savedDates));\n            \n            saved.forEach(id => fd.append('post_ids[]', id));\n\n            fetch('https:\/\/theme.co.id\/installer\/wp-admin\/admin-ajax.php', { method: 'POST', body: fd })\n            .then(res => res.json())\n            .then(res => {\n                if (res.success) {\n                    if (res.data.empty) {\n                        if (saved.length > 0 && page > 1) {\n                            loadSavedPosts(page - 1);\n                        } else {\n                            container.innerHTML = emptyHtml;\n                        }\n                    } else {\n                        container.innerHTML = res.data.html + (res.data.pagination || '');\n                        currentPage = page;\n                        \n                        container.querySelectorAll('.gp-remove-bookmark').forEach(btn => {\n                            btn.addEventListener('click', function() {\n                                const removeId = parseInt(this.getAttribute('data-id'));\n                                let curr = JSON.parse(localStorage.getItem(\"gp_saved_posts\")) || [];\n                                let currDates = JSON.parse(localStorage.getItem(\"gp_saved_dates\")) || {};\n                                \n                                curr = curr.filter(id => id !== removeId);\n                                delete currDates[removeId];\n                                \n                                localStorage.setItem(\"gp_saved_posts\", JSON.stringify(curr));\n                                localStorage.setItem(\"gp_saved_dates\", JSON.stringify(currDates));\n                                document.dispatchEvent(new Event(\"gp_bookmark_updated\"));\n                                \n                                if (curr.length === 0) {\n                                    container.innerHTML = emptyHtml;\n                                } else {\n                                    loadSavedPosts(currentPage);\n                                }\n                            });\n                        });\n\n                        container.querySelectorAll('.gp-saved-pagination a').forEach(link => {\n                            link.addEventListener('click', function(e) {\n                                e.preventDefault();\n                                let href = this.getAttribute('href');\n                                let newPage = parseInt(href.replace('#page-', ''));\n                                if (newPage) {\n                                    container.innerHTML = '<p style=\"font-size:13px;\">Loading Article ...<\/p>';\n                                    loadSavedPosts(newPage);\n                                }\n                            });\n                        });\n                    }\n                }\n            });\n        }\n        \n        loadSavedPosts(1);\n    });\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-12628","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/pages\/12628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/comments?post=12628"}],"version-history":[{"count":0,"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/pages\/12628\/revisions"}],"wp:attachment":[{"href":"https:\/\/theme.co.id\/installer\/wp-json\/wp\/v2\/media?parent=12628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}