Changeset 3833010
- Timestamp:
- 11/29/2026 12:38:59 PM (9 hours ago)
- Location:
- dealroot
- Files:
-
- 8 edited
- 1 copied
-
tags/1.1.5 (copied) (copied from dealroot/trunk )
-
tags/1.1.5/dealroot.php (modified) (2 diffs)
-
tags/1.1.5/includes/admin/class-admin.php (modified) (1 diff)
-
tags/1.1.5/includes/admin/class-shell.php (modified) (13 diffs)
-
tags/1.1.5/readme.txt (modified) (2 diffs)
-
trunk/dealroot.php (modified) (2 diffs)
-
trunk/includes/admin/class-admin.php (modified) (1 diff)
-
trunk/includes/admin/class-shell.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dealroot/tags/1.1.5/dealroot.php
r3831796 r3833010 4 4 * Plugin URI: https://dealroot.net/docs/ 5 5 * Description: See where every lead comes from, follow it to a sale, and get notified the moment it arrives. 6 * Version: 1.1. 46 * Version: 1.1.5 7 7 * Requires at least: 6.8 8 8 * Requires PHP: 7.4 … … 19 19 defined( 'ABSPATH' ) || exit; 20 20 21 define( 'DEALROOT_VERSION', '1.1. 4' );21 define( 'DEALROOT_VERSION', '1.1.5' ); 22 22 define( 'DEALROOT_FILE', __FILE__ ); 23 23 define( 'DEALROOT_DIR', plugin_dir_path( __FILE__ ) ); -
dealroot/tags/1.1.5/includes/admin/class-admin.php
r3830572 r3833010 112 112 add_action( 'admin_menu', array( $this, 'menu' ) ); 113 113 // After every plugin changed the menu, before it is shown. 114 add_action( 'admin_head', array( Shell::class, 'shorten_menu' ) );115 114 add_action( 'admin_init', array( new Settings_Page(), 'register_settings' ) ); 116 115 add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); -
dealroot/tags/1.1.5/includes/admin/class-shell.php
r3830572 r3833010 22 22 23 23 /** 24 * The Dealroot screens of the admin menu before it was shortened to one item per group.25 *26 * @var string[]|null27 */28 private static $menu = null;29 30 /**31 24 * Screens in the bar, in their order. Add-ons add theirs with the dealroot_admin_screens filter. 32 25 * … … 43 36 $screens = array( 44 37 'overview' => array( 45 'group' => 'overview',46 38 'label' => __( 'Overview', 'dealroot' ), 47 39 'page' => Admin::PAGE, … … 50 42 ), 51 43 'live' => array( 52 'group' => 'leads',53 44 'label' => __( 'Live', 'dealroot' ), 54 45 'page' => Live_Page::PAGE, … … 58 49 ), 59 50 'leads' => array( 60 'group' => 'leads',61 51 'label' => __( 'Leads', 'dealroot' ), 62 52 'page' => Admin::LEADS_PAGE, … … 66 56 ), 67 57 'ask' => array( 68 'group' => 'reports', 69 'label' => __( 'Ask a question', 'dealroot' ), 58 'label' => __( 'Ask', 'dealroot' ), 70 59 'page' => Ask_Page::PAGE, 71 60 'capability' => Admin::capability(), … … 73 62 ), 74 63 'reports' => array( 75 'group' => 'reports',76 64 'label' => __( 'Reports', 'dealroot' ), 77 65 'page' => Reports_Page::PAGE, … … 80 68 ), 81 69 'forms' => array( 82 'group' => 'website',83 70 'label' => __( 'Forms', 'dealroot' ), 84 71 'page' => Forms_Page::PAGE, … … 87 74 ), 88 75 'settings' => array( 89 'group' => 'settings',90 76 'label' => __( 'Settings', 'dealroot' ), 91 77 'page' => Admin::SETTINGS_PAGE, … … 95 81 ); 96 82 83 // Not in the admin menu, so it stays out of the way, but a tab at the end of the bar. 97 84 $screens['features'] = array( 98 85 'label' => __( 'All features', 'dealroot' ), 99 86 'page' => Features_Page::PAGE, 100 'group' => 'settings',101 87 'capability' => 'manage_options', 102 88 'order' => 99, … … 112 98 113 99 // A screen that was taken out of the menu, e.g. for a white label, leaves the bar too. 114 $menu = null !== self::$menu ? self::$menu :wp_list_pluck( (array) ( $submenu[ Admin::PAGE ] ?? array() ), 2 );100 $menu = wp_list_pluck( (array) ( $submenu[ Admin::PAGE ] ?? array() ), 2 ); 115 101 116 102 $screens = array_filter( … … 135 121 136 122 return $screens; 137 }138 139 /**140 * The groups of the bar, in their order: a few words a person looks for, each with its141 * screens as tabs below the bar.142 *143 * @return array<string, string> Group key => label.144 */145 public static function groups() {146 /**147 * Filters the groups of the bar.148 *149 * @param array<string, string> $groups Group key => label.150 */151 return (array) apply_filters(152 'dealroot_admin_groups',153 array(154 'overview' => __( 'Overview', 'dealroot' ),155 'leads' => __( 'Leads', 'dealroot' ),156 'reports' => __( 'Reports', 'dealroot' ),157 'website' => __( 'Your website', 'dealroot' ),158 'ads' => __( 'Ads', 'dealroot' ),159 'settings' => __( 'Settings', 'dealroot' ),160 )161 );162 }163 164 /**165 * Group of a screen; a screen without one gets its own place in the bar.166 *167 * @param string $key Screen key.168 * @param array $screen Screen.169 * @return string170 */171 private static function group_of( $key, array $screen ) {172 return isset( $screen['group'] ) && isset( self::groups()[ $screen['group'] ] ) ? (string) $screen['group'] : (string) $key;173 }174 175 /**176 * Shortens the Dealroot part of the admin menu to one item per group, named like the group,177 * as in the bar: the other screens are reached by the tabs and stay where they are.178 */179 public static function shorten_menu() {180 global $submenu;181 182 if ( empty( $submenu[ Admin::PAGE ] ) ) {183 return;184 }185 186 self::$menu = wp_list_pluck( $submenu[ Admin::PAGE ], 2 );187 188 $labels = self::groups();189 $first = array();190 $others = array();191 192 foreach ( self::screens() as $key => $screen ) {193 $group = self::group_of( $key, $screen );194 195 if ( ! isset( $first[ $group ] ) ) {196 $first[ $group ] = $screen['page'];197 } else {198 $others[] = $screen['page'];199 }200 }201 202 $pages = array_flip( $first );203 $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only which item is current.204 205 // A screen reached by a tab marks the item of its group as current.206 foreach ( self::screens() as $key => $screen ) {207 if ( $screen['page'] === $page && in_array( $page, $others, true ) ) {208 $GLOBALS['submenu_file'] = $first[ self::group_of( $key, $screen ) ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Highlights our own item.209 }210 }211 212 foreach ( $submenu[ Admin::PAGE ] as $index => $item ) {213 if ( in_array( $item[2], $others, true ) ) {214 unset( $submenu[ Admin::PAGE ][ $index ] );215 } elseif ( isset( $pages[ $item[2] ], $labels[ $pages[ $item[2] ] ] ) ) {216 $submenu[ Admin::PAGE ][ $index ][0] = $labels[ $pages[ $item[2] ] ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Only the label of our own item.217 }218 }219 123 } 220 124 … … 316 220 <span><?php esc_html_e( 'Dealroot', 'dealroot' ); ?></span> 317 221 </a> 318 <?php319 $screens = self::screens();320 $labels = self::groups();321 $groups = array();322 323 foreach ( $screens as $key => $screen ) {324 $groups[ self::group_of( $key, $screen ) ][ $key ] = $screen;325 }326 327 // The groups in their own order, screens without a group where their first screen is.328 uksort(329 $groups,330 static function ( $a, $b ) use ( $labels ) {331 $order = array_flip( array_keys( $labels ) );332 333 return ( $order[ $a ] ?? 50 ) <=> ( $order[ $b ] ?? 50 );334 }335 );336 337 $active = isset( $screens[ $current ] ) ? self::group_of( $current, $screens[ $current ] ) : '';338 ?>339 222 <ul class="dealroot-appbar__screens"> 340 <?php foreach ( $groups as $group => $members ) : ?> 341 <?php 342 $first = reset( $members ); 343 $count = 0; 344 $live = null; 345 346 foreach ( $members as $member ) { 347 $count += (int) ( $member['count'] ?? 0 ); 348 $live = isset( $member['live'] ) ? (int) $member['live'] : $live; 349 } 350 351 $label = 1 === count( $members ) && ! isset( $labels[ $group ] ) ? $first['label'] : ( $labels[ $group ] ?? $first['label'] ); 352 ?> 223 <?php foreach ( self::screens() as $key => $screen ) : ?> 353 224 <li> 354 <a href="<?php echo esc_url( self::url( $ first['page'] ) ); ?>"<?php echo $group === $active? ' class="is-current" aria-current="page"' : ''; ?>>355 <?php echo esc_html( $ label); ?>356 <?php if ( null !== $live) : ?>357 <span class="dealroot-appbar__live" data-dealroot-live-count<?php echo $ live > 0 ? '' : ' hidden'; ?>><?php echo esc_html( number_format_i18n( $live) ); ?></span>225 <a href="<?php echo esc_url( self::url( $screen['page'] ) ); ?>"<?php echo $key === $current ? ' class="is-current" aria-current="page"' : ''; ?>> 226 <?php echo esc_html( $screen['label'] ); ?> 227 <?php if ( isset( $screen['live'] ) ) : ?> 228 <span class="dealroot-appbar__live" data-dealroot-live-count<?php echo $screen['live'] > 0 ? '' : ' hidden'; ?>><?php echo esc_html( number_format_i18n( (int) $screen['live'] ) ); ?></span> 358 229 <?php endif; ?> 359 <?php if ( $count > 0) : ?>360 <span class="dealroot-appbar__count"><?php echo esc_html( number_format_i18n( $count) ); ?></span>230 <?php if ( ! empty( $screen['count'] ) ) : ?> 231 <span class="dealroot-appbar__count"><?php echo esc_html( number_format_i18n( (int) $screen['count'] ) ); ?></span> 361 232 <?php endif; ?> 362 233 </a> … … 366 237 </nav> 367 238 <?php 368 $tabs = '' !== $active ? (array) ( $groups[ $active ] ?? array() ) : array();369 370 if ( count( $tabs ) > 1 ) :371 ?>372 <nav class="dealroot-subnav" aria-label="<?php echo esc_attr( $labels[ $active ] ?? '' ); ?>">373 <?php foreach ( $tabs as $key => $screen ) : ?>374 <a href="<?php echo esc_url( self::url( $screen['page'] ) ); ?>"<?php echo $key === $current ? ' class="is-current" aria-current="page"' : ''; ?>>375 <?php echo esc_html( $screen['label'] ); ?>376 <?php if ( isset( $screen['live'] ) ) : ?>377 <span class="dealroot-appbar__live" data-dealroot-live-count="always"><?php echo esc_html( number_format_i18n( (int) $screen['live'] ) ); ?></span>378 <?php endif; ?>379 <?php if ( ! empty( $screen['count'] ) ) : ?>380 <span class="dealroot-appbar__count"><?php echo esc_html( number_format_i18n( (int) $screen['count'] ) ); ?></span>381 <?php endif; ?>382 </a>383 <?php endforeach; ?>384 </nav>385 <?php386 endif;387 388 239 if ( 'live' !== $current && Live::enabled() ) { 389 240 // The number next to "Live" stays current on the other screens too. 390 241 wp_print_inline_script_tag( 391 242 sprintf( 392 '(function(){var b=document.querySelector All("[data-dealroot-live-count]");if(!b.length||!window.fetch){return;}function u(){if("hidden"===document.visibilityState){return;}var d=new URLSearchParams();d.append("action","dealroot_live_count");d.append("nonce",%1$s);fetch(%2$s,{method:"POST",credentials:"same-origin",body:d}).then(function(r){return r.json();}).then(function(r){if(r&&r.success){b.forEach(function(e){e.textContent=Number(r.data).toLocaleString();e.hidden=0===Number(r.data)&&"always"!==e.getAttribute("data-dealroot-live-count");});}}).catch(function(){});}setInterval(u,15000);document.addEventListener("visibilitychange",u);})();',243 '(function(){var b=document.querySelector("[data-dealroot-live-count]");if(!b||!window.fetch){return;}function u(){if("hidden"===document.visibilityState){return;}var d=new URLSearchParams();d.append("action","dealroot_live_count");d.append("nonce",%1$s);fetch(%2$s,{method:"POST",credentials:"same-origin",body:d}).then(function(r){return r.json();}).then(function(r){if(r&&r.success){b.textContent=Number(r.data).toLocaleString();b.hidden=0===Number(r.data);}}).catch(function(){});}setInterval(u,15000);document.addEventListener("visibilitychange",u);})();', 393 244 wp_json_encode( wp_create_nonce( 'dealroot_live_count' ) ), 394 245 wp_json_encode( admin_url( 'admin-ajax.php' ) ) -
dealroot/tags/1.1.5/readme.txt
r3831796 r3833010 5 5 Tested up to: 7.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 47 Stable tag: 1.1.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 218 218 219 219 == Changelog == 220 221 = 1.1.5 = 222 * The bar at the top of the Dealroot screens shows every screen again, and the admin menu lists them all, as before 1.1.0. "All features" is the last tab of the bar. 220 223 221 224 = 1.1.4 = -
dealroot/trunk/dealroot.php
r3831796 r3833010 4 4 * Plugin URI: https://dealroot.net/docs/ 5 5 * Description: See where every lead comes from, follow it to a sale, and get notified the moment it arrives. 6 * Version: 1.1. 46 * Version: 1.1.5 7 7 * Requires at least: 6.8 8 8 * Requires PHP: 7.4 … … 19 19 defined( 'ABSPATH' ) || exit; 20 20 21 define( 'DEALROOT_VERSION', '1.1. 4' );21 define( 'DEALROOT_VERSION', '1.1.5' ); 22 22 define( 'DEALROOT_FILE', __FILE__ ); 23 23 define( 'DEALROOT_DIR', plugin_dir_path( __FILE__ ) ); -
dealroot/trunk/includes/admin/class-admin.php
r3830572 r3833010 112 112 add_action( 'admin_menu', array( $this, 'menu' ) ); 113 113 // After every plugin changed the menu, before it is shown. 114 add_action( 'admin_head', array( Shell::class, 'shorten_menu' ) );115 114 add_action( 'admin_init', array( new Settings_Page(), 'register_settings' ) ); 116 115 add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); -
dealroot/trunk/includes/admin/class-shell.php
r3830572 r3833010 22 22 23 23 /** 24 * The Dealroot screens of the admin menu before it was shortened to one item per group.25 *26 * @var string[]|null27 */28 private static $menu = null;29 30 /**31 24 * Screens in the bar, in their order. Add-ons add theirs with the dealroot_admin_screens filter. 32 25 * … … 43 36 $screens = array( 44 37 'overview' => array( 45 'group' => 'overview',46 38 'label' => __( 'Overview', 'dealroot' ), 47 39 'page' => Admin::PAGE, … … 50 42 ), 51 43 'live' => array( 52 'group' => 'leads',53 44 'label' => __( 'Live', 'dealroot' ), 54 45 'page' => Live_Page::PAGE, … … 58 49 ), 59 50 'leads' => array( 60 'group' => 'leads',61 51 'label' => __( 'Leads', 'dealroot' ), 62 52 'page' => Admin::LEADS_PAGE, … … 66 56 ), 67 57 'ask' => array( 68 'group' => 'reports', 69 'label' => __( 'Ask a question', 'dealroot' ), 58 'label' => __( 'Ask', 'dealroot' ), 70 59 'page' => Ask_Page::PAGE, 71 60 'capability' => Admin::capability(), … … 73 62 ), 74 63 'reports' => array( 75 'group' => 'reports',76 64 'label' => __( 'Reports', 'dealroot' ), 77 65 'page' => Reports_Page::PAGE, … … 80 68 ), 81 69 'forms' => array( 82 'group' => 'website',83 70 'label' => __( 'Forms', 'dealroot' ), 84 71 'page' => Forms_Page::PAGE, … … 87 74 ), 88 75 'settings' => array( 89 'group' => 'settings',90 76 'label' => __( 'Settings', 'dealroot' ), 91 77 'page' => Admin::SETTINGS_PAGE, … … 95 81 ); 96 82 83 // Not in the admin menu, so it stays out of the way, but a tab at the end of the bar. 97 84 $screens['features'] = array( 98 85 'label' => __( 'All features', 'dealroot' ), 99 86 'page' => Features_Page::PAGE, 100 'group' => 'settings',101 87 'capability' => 'manage_options', 102 88 'order' => 99, … … 112 98 113 99 // A screen that was taken out of the menu, e.g. for a white label, leaves the bar too. 114 $menu = null !== self::$menu ? self::$menu :wp_list_pluck( (array) ( $submenu[ Admin::PAGE ] ?? array() ), 2 );100 $menu = wp_list_pluck( (array) ( $submenu[ Admin::PAGE ] ?? array() ), 2 ); 115 101 116 102 $screens = array_filter( … … 135 121 136 122 return $screens; 137 }138 139 /**140 * The groups of the bar, in their order: a few words a person looks for, each with its141 * screens as tabs below the bar.142 *143 * @return array<string, string> Group key => label.144 */145 public static function groups() {146 /**147 * Filters the groups of the bar.148 *149 * @param array<string, string> $groups Group key => label.150 */151 return (array) apply_filters(152 'dealroot_admin_groups',153 array(154 'overview' => __( 'Overview', 'dealroot' ),155 'leads' => __( 'Leads', 'dealroot' ),156 'reports' => __( 'Reports', 'dealroot' ),157 'website' => __( 'Your website', 'dealroot' ),158 'ads' => __( 'Ads', 'dealroot' ),159 'settings' => __( 'Settings', 'dealroot' ),160 )161 );162 }163 164 /**165 * Group of a screen; a screen without one gets its own place in the bar.166 *167 * @param string $key Screen key.168 * @param array $screen Screen.169 * @return string170 */171 private static function group_of( $key, array $screen ) {172 return isset( $screen['group'] ) && isset( self::groups()[ $screen['group'] ] ) ? (string) $screen['group'] : (string) $key;173 }174 175 /**176 * Shortens the Dealroot part of the admin menu to one item per group, named like the group,177 * as in the bar: the other screens are reached by the tabs and stay where they are.178 */179 public static function shorten_menu() {180 global $submenu;181 182 if ( empty( $submenu[ Admin::PAGE ] ) ) {183 return;184 }185 186 self::$menu = wp_list_pluck( $submenu[ Admin::PAGE ], 2 );187 188 $labels = self::groups();189 $first = array();190 $others = array();191 192 foreach ( self::screens() as $key => $screen ) {193 $group = self::group_of( $key, $screen );194 195 if ( ! isset( $first[ $group ] ) ) {196 $first[ $group ] = $screen['page'];197 } else {198 $others[] = $screen['page'];199 }200 }201 202 $pages = array_flip( $first );203 $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only which item is current.204 205 // A screen reached by a tab marks the item of its group as current.206 foreach ( self::screens() as $key => $screen ) {207 if ( $screen['page'] === $page && in_array( $page, $others, true ) ) {208 $GLOBALS['submenu_file'] = $first[ self::group_of( $key, $screen ) ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Highlights our own item.209 }210 }211 212 foreach ( $submenu[ Admin::PAGE ] as $index => $item ) {213 if ( in_array( $item[2], $others, true ) ) {214 unset( $submenu[ Admin::PAGE ][ $index ] );215 } elseif ( isset( $pages[ $item[2] ], $labels[ $pages[ $item[2] ] ] ) ) {216 $submenu[ Admin::PAGE ][ $index ][0] = $labels[ $pages[ $item[2] ] ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Only the label of our own item.217 }218 }219 123 } 220 124 … … 316 220 <span><?php esc_html_e( 'Dealroot', 'dealroot' ); ?></span> 317 221 </a> 318 <?php319 $screens = self::screens();320 $labels = self::groups();321 $groups = array();322 323 foreach ( $screens as $key => $screen ) {324 $groups[ self::group_of( $key, $screen ) ][ $key ] = $screen;325 }326 327 // The groups in their own order, screens without a group where their first screen is.328 uksort(329 $groups,330 static function ( $a, $b ) use ( $labels ) {331 $order = array_flip( array_keys( $labels ) );332 333 return ( $order[ $a ] ?? 50 ) <=> ( $order[ $b ] ?? 50 );334 }335 );336 337 $active = isset( $screens[ $current ] ) ? self::group_of( $current, $screens[ $current ] ) : '';338 ?>339 222 <ul class="dealroot-appbar__screens"> 340 <?php foreach ( $groups as $group => $members ) : ?> 341 <?php 342 $first = reset( $members ); 343 $count = 0; 344 $live = null; 345 346 foreach ( $members as $member ) { 347 $count += (int) ( $member['count'] ?? 0 ); 348 $live = isset( $member['live'] ) ? (int) $member['live'] : $live; 349 } 350 351 $label = 1 === count( $members ) && ! isset( $labels[ $group ] ) ? $first['label'] : ( $labels[ $group ] ?? $first['label'] ); 352 ?> 223 <?php foreach ( self::screens() as $key => $screen ) : ?> 353 224 <li> 354 <a href="<?php echo esc_url( self::url( $ first['page'] ) ); ?>"<?php echo $group === $active? ' class="is-current" aria-current="page"' : ''; ?>>355 <?php echo esc_html( $ label); ?>356 <?php if ( null !== $live) : ?>357 <span class="dealroot-appbar__live" data-dealroot-live-count<?php echo $ live > 0 ? '' : ' hidden'; ?>><?php echo esc_html( number_format_i18n( $live) ); ?></span>225 <a href="<?php echo esc_url( self::url( $screen['page'] ) ); ?>"<?php echo $key === $current ? ' class="is-current" aria-current="page"' : ''; ?>> 226 <?php echo esc_html( $screen['label'] ); ?> 227 <?php if ( isset( $screen['live'] ) ) : ?> 228 <span class="dealroot-appbar__live" data-dealroot-live-count<?php echo $screen['live'] > 0 ? '' : ' hidden'; ?>><?php echo esc_html( number_format_i18n( (int) $screen['live'] ) ); ?></span> 358 229 <?php endif; ?> 359 <?php if ( $count > 0) : ?>360 <span class="dealroot-appbar__count"><?php echo esc_html( number_format_i18n( $count) ); ?></span>230 <?php if ( ! empty( $screen['count'] ) ) : ?> 231 <span class="dealroot-appbar__count"><?php echo esc_html( number_format_i18n( (int) $screen['count'] ) ); ?></span> 361 232 <?php endif; ?> 362 233 </a> … … 366 237 </nav> 367 238 <?php 368 $tabs = '' !== $active ? (array) ( $groups[ $active ] ?? array() ) : array();369 370 if ( count( $tabs ) > 1 ) :371 ?>372 <nav class="dealroot-subnav" aria-label="<?php echo esc_attr( $labels[ $active ] ?? '' ); ?>">373 <?php foreach ( $tabs as $key => $screen ) : ?>374 <a href="<?php echo esc_url( self::url( $screen['page'] ) ); ?>"<?php echo $key === $current ? ' class="is-current" aria-current="page"' : ''; ?>>375 <?php echo esc_html( $screen['label'] ); ?>376 <?php if ( isset( $screen['live'] ) ) : ?>377 <span class="dealroot-appbar__live" data-dealroot-live-count="always"><?php echo esc_html( number_format_i18n( (int) $screen['live'] ) ); ?></span>378 <?php endif; ?>379 <?php if ( ! empty( $screen['count'] ) ) : ?>380 <span class="dealroot-appbar__count"><?php echo esc_html( number_format_i18n( (int) $screen['count'] ) ); ?></span>381 <?php endif; ?>382 </a>383 <?php endforeach; ?>384 </nav>385 <?php386 endif;387 388 239 if ( 'live' !== $current && Live::enabled() ) { 389 240 // The number next to "Live" stays current on the other screens too. 390 241 wp_print_inline_script_tag( 391 242 sprintf( 392 '(function(){var b=document.querySelector All("[data-dealroot-live-count]");if(!b.length||!window.fetch){return;}function u(){if("hidden"===document.visibilityState){return;}var d=new URLSearchParams();d.append("action","dealroot_live_count");d.append("nonce",%1$s);fetch(%2$s,{method:"POST",credentials:"same-origin",body:d}).then(function(r){return r.json();}).then(function(r){if(r&&r.success){b.forEach(function(e){e.textContent=Number(r.data).toLocaleString();e.hidden=0===Number(r.data)&&"always"!==e.getAttribute("data-dealroot-live-count");});}}).catch(function(){});}setInterval(u,15000);document.addEventListener("visibilitychange",u);})();',243 '(function(){var b=document.querySelector("[data-dealroot-live-count]");if(!b||!window.fetch){return;}function u(){if("hidden"===document.visibilityState){return;}var d=new URLSearchParams();d.append("action","dealroot_live_count");d.append("nonce",%1$s);fetch(%2$s,{method:"POST",credentials:"same-origin",body:d}).then(function(r){return r.json();}).then(function(r){if(r&&r.success){b.textContent=Number(r.data).toLocaleString();b.hidden=0===Number(r.data);}}).catch(function(){});}setInterval(u,15000);document.addEventListener("visibilitychange",u);})();', 393 244 wp_json_encode( wp_create_nonce( 'dealroot_live_count' ) ), 394 245 wp_json_encode( admin_url( 'admin-ajax.php' ) ) -
dealroot/trunk/readme.txt
r3831796 r3833010 5 5 Tested up to: 7.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 47 Stable tag: 1.1.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 218 218 219 219 == Changelog == 220 221 = 1.1.5 = 222 * The bar at the top of the Dealroot screens shows every screen again, and the admin menu lists them all, as before 1.1.0. "All features" is the last tab of the bar. 220 223 221 224 = 1.1.4 =
Note:
See TracChangeset
for help on using the changeset viewer.