Changeset 2853507
- Timestamp:
- 01/24/2023 12:38:57 PM (18 months ago)
- Location:
- wp-dark-mode
- Files:
-
- 257 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-dark-mode/trunk/includes/admin/class-settings-api.php
r2852513 r2853507 568 568 'name' => true, 569 569 'id' => true, 570 571 572 570 573 ], 571 574 'option' => [ -
wp-dark-mode/trunk/includes/admin/class-settings.php
r2852513 r2853507 937 937 938 938 <div> 939 <input type="number" min="0" id="bottom_spacing" name="wp_dark_mode_switch[bottom_spacing]" value="<?php echo absint( $bottom_spacing); ?>" />939 <input type="number" min="0" id="bottom_spacing" name="wp_dark_mode_switch[bottom_spacing]" value="<?php echo absint( ); ?>" /> 940 940 <span>px</span> 941 941 </div> … … 945 945 <span class="custom-position-label"><?php esc_html_e( 'Side Spacing', 'wp-dark-mode' ); ?></span> 946 946 <div> 947 <input type="number" min="0" id="side_spacing" name="wp_dark_mode_switch[side_spacing]" value="<?php echo absint( $side_spacing); ?>" />947 <input type="number" min="0" id="side_spacing" name="wp_dark_mode_switch[side_spacing]" value="<?php echo absint( ); ?>" /> 948 948 <span>px</span> 949 949 </div> … … 980 980 if ( ! empty( $menus ) && ! is_wp_error( $menus ) ) { 981 981 foreach ( $menus as $menu ) { 982 wp_sprintf( '<option value="%1$s" %2$s>%3$s</option>', $menu->slug, in_array( $menu->slug, $switch_menus, true ) ? 'selected' : '', esc_attr( $menu->name ) );982 wp_sprintf( '<option value="%1$s" %2$s>%3$s</option>', $menu->slug, in_array( $menu->slug, $switch_menus, e ) ? 'selected' : '', esc_attr( $menu->name ) ); 983 983 } 984 984 } … … 1013 1013 1014 1014 foreach ( $page_ids as $id => $title ) { 1015 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages, true ) ? 'selected' : '', esc_attr( $title ) );1015 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages, ', esc_attr( $title ) ); 1016 1016 } 1017 1017 } 1018 1018 ?> 1019 <option value="404" <?php echo in_array( '404', $exclude_pages, true ) ? 'selected' : ''; ?>>1019 <option value="404" <?php echo in_array( '404', $exclude_pages, e ) ? 'selected' : ''; ?>> 1020 1020 <?php esc_html_e( '404 Page', 'wp-dark-mode' ); ?></option> 1021 1021 </select> … … 1053 1053 1054 1054 foreach ( $page_ids as $id => $title ) { 1055 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages_except, true ) ? 'selected' : '', esc_attr( $title ) );1055 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages_except, e ) ? 'selected' : '', esc_attr( $title ) ); 1056 1056 } 1057 1057 } 1058 1058 ?> 1059 <option value="404" <?php echo in_array( '404', $exclude_pages_except, true ) ? 'selected' : ''; ?>><?php esc_html_e( '404 Page', 'wp-dark-mode' ); ?></option>1059 <option value="404" <?php echo in_array( '404', $exclude_pages_except, e ) ? 'selected' : ''; ?>><?php esc_html_e( '404 Page', 'wp-dark-mode' ); ?></option> 1060 1060 </select> 1061 1061 </div> … … 1078 1078 <div class="exclude_wrap exclude_posts_wrap <?php echo $exclude_all_posts ? 'disabled' : ''; ?>"> 1079 1079 <select name="wp_dark_mode_triggers[exclude_posts][]" multiple id="wp_dark_mode_triggers[exclude_posts]"> 1080 <?php 1081 if ( ! empty( $exclude_posts ) ) { 1082 foreach ( $exclude_posts as $post_id ) { 1083 printf( '<option value="%1$s" selected>%2$s</option>', absint( $post_id ), esc_attr( get_the_title( absint( $post_id ) ) ) ); 1084 } 1080 <?php 1081 $posts = get_posts([ 1082 'numberposts' => - 1, 1083 'post_type' => 'page', 1084 ]); 1085 1086 if ( ! empty( $posts ) ) { 1087 $page_ids = wp_list_pluck( $posts, 'post_title', 'ID' ); 1088 1089 foreach ( $page_ids as $id => $title ) { 1090 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_posts, false ) ? 'selected' : 'not', esc_attr( $title ) ); 1085 1091 } 1086 ?> 1092 } 1093 ?> 1087 1094 </select> 1088 1095 … … 1107 1114 <div class="exclude_except_select <?php echo ! $exclude_all_posts ? 'disabled' : ''; ?>"> 1108 1115 <select name="wp_dark_mode_triggers[exclude_posts_except][]" multiple 1109 id="wp_dark_mo de_triggers[exclude_posts_except]">1116 id="wp_dark_mo 1110 1117 <?php 1111 if ( ! empty( $exclude_posts_except ) ) { 1112 foreach ( $exclude_posts_except as $post_id ) { 1113 printf( '<option value="%1$s" selected>%2$s</option>', absint( $post_id ), esc_attr( get_the_title( absint( $post_id ) ) ) ); 1118 $posts = get_posts([ 1119 'numberposts' => -1, 1120 'post_type' => 'post', 1121 ]); 1122 1123 if ( ! empty( $posts ) ) { 1124 $page_ids = wp_list_pluck( $posts, 'post_title', 'ID' ); 1125 1126 foreach ( $page_ids as $id => $title ) { 1127 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_posts_except, false ) ? 'selected' : '', esc_attr( $title ) ); 1114 1128 } 1115 1129 } … … 1196 1210 if ( ! empty( $cats ) && ! is_wp_error( $cats ) ) { 1197 1211 foreach ( $cats as $cat ) { 1198 printf( '<option value="%1$s" %2$s>%3$s</option>', $cat->term_id, in_array( $cat->term_id, $exclude_categories, true ) ? 'selected' : '', esc_attr( $cat->name ) );1212 printf( '<option value="%1$s" %2$s>%3$s</option>', $cat->term_id, in_array( $cat->term_id, $exclude_categories, e ) ? 'selected' : '', esc_attr( $cat->name ) ); 1199 1213 } 1200 1214 } … … 1228 1242 absint( $cat->term_id ), 1229 1243 in_array( absint( $cat->term_id ), 1230 $specific_categories, true ) ? 'selected' : '',1244 $specific_categories, e ) ? 'selected' : '', 1231 1245 esc_attr( $cat->name ) 1232 1246 ); … … 1262 1276 '<option value="%1$s" %2$s>%3$s</option>', 1263 1277 absint( $cat->term_id ), 1264 in_array( absint( $cat->term_id ), $exclude_wc_categories, true ) ? 'selected' : '',1278 in_array( absint( $cat->term_id ), $exclude_wc_categories, e ) ? 'selected' : '', 1265 1279 esc_attr( $cat->name ) 1266 1280 ); … … 1295 1309 '<option value="%1$s" %2$s>%3$s</option>', 1296 1310 absint( $cat->term_id ), 1297 in_array( absint( $cat->term_id ), $specific_wc_categories, true ) ? 'selected' : '',1311 in_array( absint( $cat->term_id ), $specific_wc_categories, e ) ? 'selected' : '', 1298 1312 esc_attr( $cat->name ) 1299 1313 ); … … 1386 1400 1387 1401 foreach ( $post_types as $post_type ) { 1388 printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $post_type ), in_array( $post_type, $exclude_post_types, true ) ? 'selected' : '', esc_attr( $post_type ) );1402 printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $post_type ), in_array( $post_type, $exclude_post_types, e ) ? 'selected' : '', esc_attr( $post_type ) ); 1389 1403 } 1390 1404 ?> -
wp-dark-mode/trunk/includes/appsero/src/Client.php
r2852513 r2853507 246 246 $headers = [ 247 247 'user-agent' => 'Appsero/' . md5( esc_url( home_url() ) ) . ';', 248 'Accept' => 'application/json' 248 'Accept' => 'application/json' 249 249 ]; 250 250 … … 257 257 'headers' => $headers, 258 258 'body' => array_merge( $params, [ 'client' => $this->version ] ), 259 'cookies' => [] 259 'cookies' => [] 260 260 ] ); 261 261 … … 269 269 */ 270 270 public function is_local_server() { 271 $is_local = in_array( sanitize_text_field( wp_unslash( isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' ) ), [ '127.0.0.1', '::1' ], true );271 $is_local = in_array( sanitize_text_field( wp_unslash( isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' ) ), [ '127.0.0.1', '::1' ], e ); 272 272 273 273 return apply_filters( 'appsero_is_local', $is_local ); -
wp-dark-mode/trunk/includes/appsero/src/Insights.php
r2852513 r2853507 229 229 'order' => 'ASC', 230 230 'number' => 1, 231 'paged' => 1 231 'paged' => 1 232 232 ] ); 233 233 … … 256 256 'project_version' => $this->client->project_version, 257 257 'tracking_skipped' => false, 258 'is_local' => $this->is_local_server() 258 'is_local' => $this->is_local_server() 259 259 ]; 260 260 … … 272 272 $plugins_data[ $slug ] = [ 273 273 'name' => isset( $plugin['name'] ) ? $plugin['name'] : '', 274 'version' => isset( $plugin['version'] ) ? $plugin['version'] : '' 274 'version' => isset( $plugin['version'] ) ? $plugin['version'] : '' 275 275 ]; 276 276 } … … 329 329 'Number of active and inactive plugins', 330 330 'Site name and URL', 331 'Your name and email address' 331 'Your name and email address' 332 332 ]; 333 333 … … 381 381 private function is_local_server() { 382 382 383 $host = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : 'localhost';383 $host = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ): 'localhost'; 384 384 $ip = isset( $_SERVER['SERVER_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_ADDR'] ) ) : '127.0.0.1'; 385 385 $is_local = false; 386 386 387 if ( in_array( $ip, [ '127.0.0.1', '::1' ], true ) || ! strpos( $host, '.' ) || in_array( strrchr( $host, '.' ), [ '.test', '.testing', '.local', '.localhost', '.localdomain' ], true ) ) {387 if ( in_array( $ip, [ '127.0.0.1', '::1' ], e ) ) { 388 388 $is_local = true; 389 389 } … … 440 440 $optin_url = add_query_arg( [ 441 441 $this->client->slug . '_tracker_optin' => 'true', 442 'wpnonce' => wp_create_nonce( 'appsero-security-nonce' ) 442 'wpnonce' => wp_create_nonce( 'appsero-security-nonce' ) 443 443 ] ); 444 444 445 445 $optout_url = add_query_arg( [ 446 446 $this->client->slug . '_tracker_optout' => 'true', 447 'wpnonce' => wp_create_nonce( 'appsero-security-nonce' ) 447 'wpnonce' => wp_create_nonce( 'appsero-security-nonce' ) 448 448 ] ); 449 449 … … 660 660 } 661 661 662 if ( in_array( $k, $active_plugins_keys, true ) ) {662 if ( in_array( $k, $active_plugins_keys, e ) ) { 663 663 // Removes active plugins from list so we can show active and inactive separately. 664 664 unset( $plugins[ $k ] ); … … 671 671 return [ 672 672 'active_plugins' => $active_plugins, 673 'inactive_plugins' => $plugins 673 'inactive_plugins' => $plugins 674 674 ]; 675 675 } … … 708 708 $schedules['weekly'] = [ 709 709 'interval' => DAY_IN_SECONDS * 7, 710 'display' => 'Once Weekly' 710 'display' => 'Once Weekly' 711 711 ]; 712 712 … … 1102 1102 $data = [ 1103 1103 'hash' => $this->client->hash, 1104 'previously_skipped' => false 1104 'previously_skipped' => false 1105 1105 ]; 1106 1106 -
wp-dark-mode/trunk/includes/class-base.php
r2852513 r2853507 62 62 * Integrate WPPOOL Plugin 63 63 */ 64 $wpdm_plugin = new \WPPOOL\ Plugin( 'wp_dark_mode' );64 $wpdm_plugin = new \WPPOOL\Plugin( 'wp_dark_mode' ); 65 65 66 66 if ( method_exists( $wpdm_plugin, 'appsero' ) ) { -
wp-dark-mode/trunk/includes/class-enqueue.php
r2852513 r2853507 80 80 $post_fix = $performance_mode ? '-defer' : ''; 81 81 82 wp_enqueue_script( "wp-dark-mode-js{$post_fix}", WP_DARK_MODE_ASSETS . '/js/dark-mode.min.js', [ 'jquery'], WP_DARK_MODE_VERSION, $performance_mode );82 wp_enqueue_script( "wp-dark-mode-js{$post_fix}", WP_DARK_MODE_ASSETS . '/js/dark-mode.min.js', [], WP_DARK_MODE_VERSION, $performance_mode ); 83 83 } 84 84 -
wp-dark-mode/trunk/includes/class-theme-supports.php
r2852513 r2853507 106 106 $theme_parent_name = ! empty( $theme->parent()->name ) ? $theme->parent()->name : ''; 107 107 108 return in_array( $check_theme, [ $theme_name, $theme_parent_name ], true );108 return in_array( $check_theme, [ $theme_name, $theme_parent_name ], e ); 109 109 110 110 } -
wp-dark-mode/trunk/includes/functions.php
r2852513 r2853507 171 171 172 172 if ( $exclude_all_pages ) { 173 $is_excluded = isset( $post->ID ) && ! in_array( $post->ID, wp_dark_mode_exclude_pages_except(), true );173 $is_excluded = isset( $post->ID ) && ! in_array( $post->ID, wp_dark_mode_exclude_pages_except(), e ); 174 174 } else { 175 $is_excluded = isset( $post->ID ) && in_array( $post->ID, wp_dark_mode_exclude_pages(), true );175 $is_excluded = isset( $post->ID ) && in_array( $post->ID, wp_dark_mode_exclude_pages(), e ); 176 176 } 177 177 -
wp-dark-mode/trunk/includes/modules/social-share.php
r2852513 r2853507 699 699 700 700 // If post type is not enabled, return content. 701 if ( ! $post_types || ! is_array( $post_types ) || ! in_array( get_post_type(), $post_types, true ) ) {701 if ( ! $post_types || ! is_array( $post_types ) || ! in_array( get_post_type(), $post_types, e ) ) { 702 702 return $content; 703 703 } … … 807 807 808 808 // Insert. 809 $last Id = $wpdb->insert(809 $lastd = $wpdb->insert( 810 810 $table_name, 811 811 [ … … 821 821 $total_shares = array_sum( array_column( $shares, 'total' ) ); 822 822 823 if ( null !== $last Id ) {823 if ( null !== $lastd ) { 824 824 wp_send_json_success([ 825 825 'channel' => $channel, -
wp-dark-mode/trunk/includes/wppool/src/Plugin.php
r2852513 r2853507 8 8 */ 9 9 10 namespace WPPOOL ;10 namespace WPPOOL; 11 11 12 12 // Exit if accessed directly. … … 16 16 * Plugin Class 17 17 */ 18 if ( ! class_exists( '\WPPOOL\ Plugin' ) ) {18 if ( ! class_exists( '\WPPOOL\Plugin' ) ) { 19 19 /** 20 20 * Class Plugin … … 51 51 */ 52 52 protected $modes = [ 53 'development' => [54 'sheet_id' => '1G0aRZ2FExads_2L2Ub44K_dvgHlz0znDnyiLAA4wJxs',55 'tab_id' => 0,56 ],57 53 'production' => [ 58 54 'sheet_id' => '1G0aRZ2FExads_2L2Ub44K_dvgHlz0znDnyiLAA4wJxs', … … 190 186 public function enqueue_scripts() { 191 187 192 $pluginData = $this->getPluginsData();193 194 188 wp_register_script( 'wppool-plugins', '', [], time(), false ); 195 189 … … 199 193 'WPPOOL_Plugins', 200 194 [ 201 'plugins' => $pluginData,202 195 'debug' => 'development' === $this->getMode() ? true : false, 203 196 ] … … 233 226 // Subscribe to CRM. 234 227 $this->subscribe(); 235 }236 237 /**238 * Get Google Sheet URL containing the offer image url for the plugin239 *240 * @return string241 */242 protected function getSheetURL() {243 $sheetId = $this->modes[ $this->getMode() ]['sheet_id'];244 $tabId = $this->modes[ $this->getMode() ]['tab_id'];245 246 return "https://docs.google.com/spreadsheets/export?format=csv&id={$sheetId}&gid={$tabId}";247 }248 249 250 /**251 * Get offer image url from the google sheet for the plugin.252 *253 * @return mixed254 */255 protected function getSheetData() {256 $url = $this->getSheetURL();257 258 $response = wp_remote_get( $url, [259 'timeout' => 60,260 ] );261 262 if ( is_wp_error( $response ) ) {263 return false;264 }265 266 $response = wp_remote_retrieve_body( $response );267 268 if ( ! $response ) {269 return false;270 }271 272 // $response is a multidimensional array.273 $data = array_map( 'str_getcsv', explode( "\n", $response ) );274 275 $header = array_shift( $data );276 277 $data = array_map(278 function ( array $row ) use ( $header ) {279 return array_combine( $header, $row );280 },281 $data282 );283 284 // Filter plugin is not empty.285 $data = array_filter(286 $data,287 function ( $row ) {288 return ! empty( $row['name'] );289 }290 );291 292 return $data;293 }294 295 /**296 * Get Plugin Data297 *298 * @return mixed299 */300 public function getPluginsData() {301 $transient = 'wppool_plugins_data';302 303 $data = get_transient( $transient );304 305 if ( ! $data || 'development' === $this->getMode() ) {306 $data = $this->getSheetData();307 308 if ( ! $data ) {309 return false;310 }311 312 $transient_time = HOUR_IN_SECONDS;313 set_transient( $transient, $data, $transient_time );314 }315 316 return $data;317 228 } 318 229 … … 538 449 'plugins_loaded', 539 450 function() { 540 $plugin = new \WPPOOL\ Plugin();451 $plugin = new \WPPOOL\Plugin(); 541 452 $plugin->register_hooks(); 542 453 } -
wp-dark-mode/trunk/includes/wppool/src/Popup.php
r2852513 r2853507 388 388 389 389 /** 390 * Get Plugin by name391 * @param {string} name392 * @return {object} plugin393 */394 getPlugin(name) {395 return WPPOOL.plugins.find(plugin => this.toSlug(plugin.name) === name);396 }397 398 /**399 390 * Get Plugin Data 400 391 */ 401 392 get data() { 402 return this.getPlugin(this.name); 393 return { 394 button_url: 'https://go.wppool.dev/winy', 395 image_url: '', 396 button_text: 'UPGRADE NOW' 397 } 403 398 } 404 399 … … 439 434 */ 440 435 setPopupData(data) { 441 const defaultData = this.getPlugin('wp_dark_mode'); 442 443 // Change background image. 444 $container.find("._wppool-popup-modal").css({ 445 "background-image": `url(${data.image_url || ''})` 446 }); 447 448 449 450 // Check if the image url is valid image url online. 451 const fallback_image_url = '<?php echo esc_url( plugin_dir_url( __FILE__ ) . '/Image.png' ); ?>'; 452 453 if (data.image_url && data.image_url.length > 0) { 454 // check if the image url is valid image url online 455 fetch(data.image_url).then(response => { 456 if (!response.ok) { 436 437 if( data.image_url.length ) { 438 // Change background image. 439 $container.find("._wppool-popup-modal").css({ 440 "background-image": `url(${data.image_url || ''})` 441 }); 442 443 444 445 // Check if the image url is valid image url online. 446 const fallback_image_url = '<?php echo esc_url( plugin_dir_url( __FILE__ ) . '/Image.png' ); ?>'; 447 448 if (data.image_url && data.image_url.length > 0) { 449 // check if the image url is valid image url online 450 fetch(data.image_url).then(response => { 451 if (!response.ok) { 452 $container.find("._wppool-popup-modal").css({ 453 "background-image": `url(${fallback_image_url})` 454 }); 455 } 456 }).catch(error => { 457 // set default image 457 458 $container.find("._wppool-popup-modal").css({ 458 459 "background-image": `url(${fallback_image_url})` 459 460 }); 460 }461 }).catch(error => {462 // set default image463 $container.find("._wppool-popup-modal").css({464 "background-image": `url(${fallback_image_url})`465 461 }); 466 } );462 } 467 463 } 464 465 468 466 469 467 // set button text … … 571 569 572 570 /** 573 * Get Plugins574 */575 get plugins() {576 return typeof(WPPOOL_Plugins) !== 'undefined' ? WPPOOL_Plugins.plugins : [];577 },578 579 /**580 571 * Plugin 581 572 * @param String plugin … … 621 612 622 613 WPPOOL.Log({ 623 "Plugins": WPPOOL.plugins,624 614 "Debug": WPPOOL_Plugins.debug 625 615 }); -
wp-dark-mode/trunk/phpcs.xml
r2852513 r2853507 19 19 <rule ref="WordPress.WP.I18n"> 20 20 <properties>- 21 <property 22 name="text_domain" 23 type="array" 24 value="wp-dark-mode" 25 /> 21 <property name="text_domain" type="array" value="wp-dark-mode" /> 26 22 </properties> 27 23 </rule> … … 147 143 <config name="minimum_supported_wp_version" value="5.2" /> 148 144 149 <!-- WordPress -->145 <!-- WordPress --> 150 146 <rule ref="WordPress" /> 147 148 149 151 150 152 151 <!-- Allow short ternary (codition ? true : false) --> … … 158 157 </rule> 159 158 159 160 161 162 163 164 160 165 <!-- 161 166 #### #### -
wp-dark-mode/trunk/plugin.php
r2852513 r2853507 4 4 * Plugin URI: https://wppool.dev/wp-dark-mode 5 5 * Description: WP Dark Mode automatically enables a stunning dark mode of your website based on user's operating system. Supports macOS, Windows, Android & iOS. 6 * Version: 4.0. 26 * Version: 4.0. 7 7 * Author: WPPOOL 8 8 * Author URI: http://wppool.dev … … 19 19 20 20 if ( ! defined( 'WP_DARK_MODE_VERSION' ) ) { 21 define( 'WP_DARK_MODE_VERSION', '4.0. 2' );21 define( 'WP_DARK_MODE_VERSION', '4.0.' ); 22 22 define( 'WP_DARK_MODE_FILE', __FILE__ ); 23 23 define( 'WP_DARK_MODE_PATH', dirname( WP_DARK_MODE_FILE ) ); -
wp-dark-mode/trunk/readme.txt
r2852513 r2853507 5 5 Tested up to: 6.1 6 6 Requires PHP: 5.6 7 Stable tag: 4.0. 27 Stable tag: 4.0. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 171 171 172 172 == Changelog == 173 = 4.0.2 - 12 JAN 2023 = 173 174 = 4.0.3 - 24 JAN 2023 = 175 * FIXED: Removed fetching offer data from Google Sheet 176 177 = JAN 2023 = 174 178 * FIXED: Conflicting with other WPPOOL plugins 175 179 * FIXED: Updated all third-party assets -
wp-dark-mode/trunk/templates/btn-5.php
r2852513 r2853507 19 19 <div class="wp-dark-mode-switcher wp-dark-mode-ignore style-5 <?php echo ! empty( $args['class'] ) ? esc_attr( $args['class'] ) : ''; ?> <?php echo 'yes' === $args['floating'] ? 'floating ' . esc_attr( $args['position'] ) : ''; ?>"> 20 20 21 <?php21 <?php 22 22 if ( ! empty( $args['cta_text'] ) ) { 23 23 echo wp_kses_post( wp_sprintf( '<span class="wp-dark-mode-switcher-cta wp-dark-mode-ignore">%s <span class="wp-dark-mode-ignore"></span></span>', esc_html( $args['cta_text'] ) ) ); -
wp-dark-mode/trunk/templates/social-share.php
r2852513 r2853507 14 14 $counters = $wpdb->get_results( $wpdb->prepare( "SELECT count(ID) as count, channel FROM {$wpdb->prefix}wpdm_social_shares WHERE post_id = %d OR url = %s group by channel", get_the_ID(), get_permalink() ), ARRAY_A ); 15 15 16 $total Shares = array_sum( array_column( $counters, 'count' ) );16 $totalhares = array_sum( array_column( $counters, 'count' ) ); 17 17 18 18 … … 92 92 93 93 <!-- Share count --> 94 <?php if ( wp_validate_boolean( $social_share->show_total_share_count ) && $social_share->minimum_share_count <= $total Shares ) : ?>94 <?php if ( wp_validate_boolean( $social_share->show_total_share_count ) && $social_share->minimum_share_count <= $totalhares ) : ?> 95 95 <div class="_total-share wp-dark-mode-ignore"> 96 96 <div class="_total-share-count wp-dark-mode-ignore"> 97 <span><?php echo esc_html( apply_filters( 'wpdm_social_share_count', intval( $total Shares ) ) ); ?></span>97 <span><?php echo esc_html( apply_filters( 'wpdm_social_share_count', intval( $totalhares ) ) ); ?></span> 98 98 <span><?php echo esc_html( $social_share->shares_label ); ?></span> 99 99 </div>
Note: See TracChangeset
for help on using the changeset viewer.