{"id":114607,"date":"2019-12-10T10:33:06","date_gmt":"2019-12-10T10:33:06","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/dispatch-countdown\/"},"modified":"2019-12-17T11:16:07","modified_gmt":"2019-12-17T11:16:07","slug":"dispatch-countdown","status":"publish","type":"plugin","link":"https:\/\/roh.wordpress.org\/plugins\/dispatch-countdown\/","author":14170515,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.7","stable_tag":"1.0.7","tested":"5.3.21","requires":"4.0","requires_php":"5.6","requires_plugins":"","header_name":"Dispatch Countdown","header_author":"Andy Mardell","header_description":"Displays x hours left for same day dispatch on WooCommerce shop pages.","assets_banners_color":"ffffff","last_updated":"2019-12-17 11:16:07","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/mardell.me","rating":5,"author_block_rating":0,"active_installs":10,"downloads":1179,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"2209269","resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"2209269","resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"2209269","resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"2209269","resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"2209269","resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"2209269","resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"Frontend view","2":"Backend view"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[11659,179524,286],"plugin_category":[40,45],"plugin_contributors":[179525],"plugin_business_model":[],"class_list":["post-114607","plugin","type-plugin","status-publish","hentry","plugin_tags-countdown","plugin_tags-dispatch","plugin_tags-woocommerce","plugin_category-calendar-and-events","plugin_category-ecommerce","plugin_contributors-mardellme","plugin_committers-mardellme"],"banners":{"banner":"https:\/\/ps.w.org\/dispatch-countdown\/assets\/banner-772x250.png?rev=2209269","banner_2x":"https:\/\/ps.w.org\/dispatch-countdown\/assets\/banner-1544x500.png?rev=2209269","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/dispatch-countdown\/assets\/icon-128x128.png?rev=2209269","icon_2x":"https:\/\/ps.w.org\/dispatch-countdown\/assets\/icon-256x256.png?rev=2209269","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/dispatch-countdown\/assets\/screenshot-1.png?rev=2209269","caption":"Frontend view"},{"src":"https:\/\/ps.w.org\/dispatch-countdown\/assets\/screenshot-2.png?rev=2209269","caption":"Backend view"}],"raw_content":"<!--section=description-->\n<p>Specify a time to show (and start) the count down, and an end time to count down to.<\/p>\n\n<p>Ideal for displaying a message such as \"For same day dispatch, order within 1h 37m\".<\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/dispatch-countdown<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<li>Use the WooCommerce-&gt;Settings-&gt;Product Settings-&gt;Dispatch Countdown screen to configure the plugin<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How do I move the countdown?<\/dt>\n<dd><p>The countdown must be called at a point where <code>global $product<\/code> is available, so\nmake sure to call this plugin after WooCommerce has loaded. To move the\ncountdown, you can remove the action and then add it back wherever you want:<\/p>\n\n<pre><code>\/**\n * Move dispatch countdown\n *\/\nfunction your_theme_move_dispatch_countdown() {\n    \/\/ Check the class exists\n    if ( ! class_exists( 'Dispatch_Countdown' ) ) {\n        return;\n    }\n\n    \/\/ Get the current instance\n    $dispatch_countdown = Dispatch_Countdown::get_public_instance();\n\n    \/\/ Remove the action\n    remove_action( 'woocommerce_before_single_product', array( $dispatch_countdown, 'display_countdown' ) );\n\n    \/\/ Add the action back where you like\n    add_action( 'your_theme_before_main_container', array( $dispatch_countdown, 'display_countdown' ) );\n}\nadd_action( 'init', 'your_theme_move_dispatch_countdown' );\n<\/code><\/pre>\n\n<p>Replacing <code>your_theme_before_main_container<\/code> with whichever hook you wish<\/p><\/dd>\n<dt>How do I change the HTML output?<\/dt>\n<dd><p>There are a few filters available to override certain parts of the output. The\nmain filter is <code>dispatch_countdown_content<\/code> and can be used as follows:<\/p>\n\n<pre><code>\/**\n * Change countdown HTML output\n *\n * NOTE: You must include an element with the id of dispatch-countdown__time`\n<\/code><\/pre>\n\n<p>* as javascript uses this to update the countdown.\n *\/\n function your_theme_dispatch_countdown_content ( $html, $wording, $product, $countdown ) {\n    \/\/ Add the wording\n    $countdown_html  = esc_html( $wording );\n    \/\/ Add the element for js to update - be sure to include the product ID as shown\n    $countdown_html .= '&nbsp;';\n    \/\/ Add the countdown text\n    $countdown_html .= esc_html( $countdown );\n    \/\/ Close the countdown element\n    $countdown_html .= '';<\/p>\n\n<pre><code>return $countdown_html;\n<\/code><\/pre>\n\n<p>}\n add_filter( 'dispatch_countdown_content', 'your_theme_dispatch_countdown_content', 10, 4 );`<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.7<\/h4>\n\n<ul>\n<li>Update docs<\/li>\n<li>Add POT file for translations<\/li>\n<li>Adds filters to main output<\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Allow dispatch countdown hook to be overridden<\/li>\n<li>Update documentation with how to move<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Remove some dist files<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>No changes - deployment tests only<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>No changes - deployment tests only<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Added icons<\/li>\n<li>Added screenshots<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Updated readme.txt to adhere to WordPress standards<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"A plugin which allows you to display a countdown banner on your WooCommerce product pages.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/114607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=114607"}],"author":[{"embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mardellme"}],"wp:attachment":[{"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=114607"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=114607"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=114607"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=114607"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=114607"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/roh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=114607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}