{"id":1350,"date":"2021-03-14T22:22:20","date_gmt":"2021-03-14T19:22:20","guid":{"rendered":"https:\/\/www.pexlechris.dev\/library-viewer\/?page_id=1350"},"modified":"2024-11-30T21:34:04","modified_gmt":"2024-11-30T18:34:04","slug":"globals","status":"publish","type":"page","link":"https:\/\/www.pexlechris.dev\/library-viewer\/docs\/globals\/","title":{"rendered":"Property `globals`"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The last parameter of almost all the hooks of Library Viewer is the global property of the current object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Watch out!! The same hook maybe can be called in 2 different objects, as you can see below.<br>The solution to this is the $globals[&#8216;current_viewer&#8217;] that you can use with conditional logic.<\/p>\n\n\n<h4>Select the plugins that you use:<\/h4>\t<form id=\"choose_lv_docs_plugins\" method=\"post\" action=\"\">\r\n\t\t<span>\r\n\t\t\t<input type=\"checkbox\" checked name=\"library-viewer\" value=\"yes\" style=\"pointer-events: none; filter: grayscale(0.8);\">\r\n\t\t\t<label for=\"library-viewer\" style=\"pointer-events: none;\">Library Viewer<\/label>\r\n\t\t<\/span>\r\n\t\t<br>\r\n\t\t<span>\t\r\n\t\t\t<input style=\"cursor:pointer\" type=\"checkbox\" id=\"library-viewer-pro\" name=\"library-viewer-pro\" value=\"yes\" >\r\n\t\t\t<label style=\"cursor:pointer\" for=\"library-viewer-pro\">Library Viewer Pro<\/label>\r\n\t\t<\/span>\r\n\t\t<br>\r\n\t\t<span>\r\n\t\t\t<input style=\"cursor:pointer\" type=\"checkbox\" id=\"library-viewer-file-manager\" name=\"library-viewer-file-manager\" value=\"yes\" >\r\n\t\t\t<label style=\"cursor:pointer\" for=\"library-viewer-file-manager\">File Manager Add-On<\/label>\r\n\t\t<\/span>\r\n\t\t<br>\r\n        <span>\r\n\t\t\t<input style=\"cursor:pointer\" type=\"checkbox\" id=\"library-viewer-for-woocommerce\" name=\"library-viewer-for-woocommerce\" value=\"yes\" >\r\n\t\t\t<label style=\"cursor:pointer\" for=\"library-viewer-for-woocommerce\">Woocommerce Add-On<\/label>\r\n\t\t<\/span>\r\n        <br>\r\n\t\t<input type=\"submit\" value=\"Select\">\r\n\t<\/form>\r\n\t<br>\r\n\t\n\n\n\n\n\n\t<style>\r\n\t\t#toggle_sidebar{\r\n\t\t\tdisplay: block !important; \r\n\t\t\tcursor: pointer;\r\n\t\t}\r\n\t\t#toggle_sidebar:hover{\r\n\t\t\tcolor: #ab46f8;\r\n\t\t}\r\n\t\t\t  \r\n\t\t#primary.for_toggle_no_padding{\r\n\t\t\tpadding: 0 !important;\r\n\t\t}\r\n\t<\/style>\r\n\t\t\t  \r\n\t<script>\r\n\t\tfunction toggle_sidebar(){\r\n\t\t\tlet t = document.getElementById(\"toggle_sidebar\");\r\n\t\t\tlet s = document.getElementById(\"zak-secondary\");\r\n\t\t\tlet p = document.getElementById(\"zak-primary\");\r\n\t\t\tif( s.style.display == \"none\" ){\r\n\t\t\t\ts.style.display = \"block\";\r\n\t\t\t\tt.innerText = \"Close sidebar\";\r\n\t\t\t\tp.style.width = \"70%\";\r\n\t\t\t\tp.classList.remove(\"for_toggle_no_padding\");\r\n\t\t\t}else{\r\n\t\t\t\ts.style.display = \"none\";\r\n\t\t\t\tt.innerText = \"Open sidebar\";\r\n\t\t\t\tp.style.width = \"100%\";\r\n\t\t\t\tp.classList.add(\"for_toggle_no_padding\");\r\n\t\t\t}\r\n\t\t} \r\n\t<\/script>\r\n\t\t\t  \r\n\t\n","protected":false},"excerpt":{"rendered":"<p>The last parameter of almost all the hooks of Library Viewer is the global property of the current object. Watch out!! The same hook maybe can be called in 2 different objects, as you can see below.The solution to this is the $globals[&#8216;current_viewer&#8217;] that you can use with conditional logic.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1254,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"footnotes":""},"class_list":["post-1350","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/pages\/1350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/comments?post=1350"}],"version-history":[{"count":11,"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/pages\/1350\/revisions"}],"predecessor-version":[{"id":2674,"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/pages\/1350\/revisions\/2674"}],"up":[{"embeddable":true,"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/pages\/1254"}],"wp:attachment":[{"href":"https:\/\/www.pexlechris.dev\/library-viewer\/wp-json\/wp\/v2\/media?parent=1350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}