Changeset 3156633
- Timestamp:
- 09/24/2024 06:46:09 AM (19 months ago)
- Location:
- wp-widget-disable
- Files:
-
- 16 edited
- 1 copied
-
tags/3.0.1 (copied) (copied from wp-widget-disable/trunk)
-
tags/3.0.1/CHANGELOG.md (modified) (1 diff)
-
tags/3.0.1/classes/class-wp-widget-disable.php (modified) (28 diffs)
-
tags/3.0.1/vendor/autoload.php (modified) (1 diff)
-
tags/3.0.1/vendor/composer/ClassLoader.php (modified) (24 diffs)
-
tags/3.0.1/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/3.0.1/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/3.0.1/vendor/composer/installed.php (modified) (2 diffs)
-
tags/3.0.1/wp-widget-disable.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/classes/class-wp-widget-disable.php (modified) (28 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (24 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/wp-widget-disable.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-widget-disable/tags/3.0.1/CHANGELOG.md
r2887107 r3156633 5 5 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 6 7 ### [3.0.1] - 2024-09-19 8 9 * Enhancement: Code cleanup, ensuring WordPress 6.6 compatibility. 10 7 11 ### [3.0.0] - 2022-03-17 12 8 13 * Fixed: Replace use of jQuery to avoid deprecation warnings. 9 14 * Changed: Requires at least PHP 7.4 and WordPress 6.0. -
wp-widget-disable/tags/3.0.1/classes/class-wp-widget-disable.php
r2695407 r3156633 8 8 */ 9 9 class WP_Widget_Disable { 10 /**11 * Plugin version.12 */13 const VERSION = '2.1.0';14 10 15 11 /** … … 56 52 * Adds hooks. 57 53 */ 58 public function add_hooks() {54 public function add_hooks(): void { 59 55 add_action( 'init', [ $this, 'load_textdomain' ] ); 60 56 … … 90 86 * @return string The URL to the plugin directory. 91 87 */ 92 protected function get_url() {88 protected function get_url(): string { 93 89 return plugin_dir_url( __DIR__ ); 94 90 } … … 99 95 * @return string The absolute path to the plugin directory. 100 96 */ 101 protected function get_path() {97 protected function get_path(): string { 102 98 return plugin_dir_path( __DIR__ ); 103 99 } … … 110 106 * @return string The plugin basename. 111 107 */ 112 protected function get_basename() {108 protected function get_basename(): string { 113 109 return plugin_basename( $this->get_path() . 'wp-widget-disable.php' ); 114 110 } … … 117 113 * Initializes the plugin, registers textdomain, etc. 118 114 */ 119 public function load_textdomain() {115 public function load_textdomain(): void { 120 116 load_plugin_textdomain( 'wp-widget-disable' ); 121 117 } … … 126 122 * @since 1.0.0 127 123 */ 128 public function admin_menu() {124 public function admin_menu(): void { 129 125 if ( is_network_admin() ) { 130 126 $this->page_hook = add_submenu_page( … … 156 152 * @since 2.0.0 157 153 */ 158 public function settings_page_load_callback() {154 public function settings_page_load_callback(): void { 159 155 $key = md5( $_SERVER['HTTP_USER_AGENT'] ); 160 156 add_filter( 'pre_site_transient_browser_' . $key, '__return_null' ); … … 171 167 * @since 1.6.0 172 168 */ 173 public function settings_page_callback() {169 public function settings_page_callback(): void { 174 170 include trailingslashit( $this->get_path() ) . 'views/admin.php'; 175 171 } … … 180 176 * @since 1.7.0 181 177 */ 182 public function settings_errors() {178 public function settings_errors(): void { 183 179 settings_errors( 'wp-widget-disable' ); 184 180 } … … 191 187 * @return bool True if settings errors exist, false if not. 192 188 */ 193 public function has_settings_errors() {189 public function has_settings_errors(): bool { 194 190 return count( get_settings_errors( 'wp-widget-disable' ) ) > 0; 195 191 } … … 204 200 * @since 1.9.0 205 201 */ 206 public function save_network_options() {202 public function save_network_options(): void { 207 203 $data = []; 208 204 … … 239 235 * @since 1.0.0 240 236 * 241 * @param array$links Plugin action links.242 * @return array243 */ 244 public function plugin_action_links( array $links ) {237 * @param mixed[] $links Plugin action links. 238 * @return mixed[] 239 */ 240 public function plugin_action_links( array $links ): array { 245 241 $settings_url = add_query_arg( 246 242 [ 'page' => 'wp-widget-disable' ], … … 270 266 * Set the default sidebar widgets. 271 267 */ 272 public function set_default_sidebar_widgets() {268 public function set_default_sidebar_widgets(): void { 273 269 $widgets = []; 274 270 … … 288 284 * Get the default dashboard widgets. 289 285 * 290 * @return arraySidebar widgets.291 */ 292 protected function get_default_dashboard_widgets() {286 * @return mixed[] Sidebar widgets. 287 */ 288 protected function get_default_dashboard_widgets(): array { 293 289 global $wp_meta_boxes; 294 290 … … 342 338 * @since 1.0.0 343 339 */ 344 public function disable_sidebar_widgets() {340 public function disable_sidebar_widgets(): void { 345 341 $widgets = (array) get_option( $this->sidebar_widgets_option, [] ); 346 342 if ( ! empty( $widgets ) ) { … … 356 352 * @since 2.0.0 357 353 * 358 * @return arrayList of disabled widget IDs.359 */ 360 protected function get_disabled_dashboard_widgets() {354 * @return mixed[] List of disabled widget IDs. 355 */ 356 protected function get_disabled_dashboard_widgets(): array { 361 357 $widgets = (array) get_option( $this->dashboard_widgets_option, [] ); 362 358 … … 376 372 * @since 2.0.0 377 373 */ 378 public function disable_dashboard_widgets_with_remote_requests() {374 public function disable_dashboard_widgets_with_remote_requests(): void { 379 375 $widgets = $this->get_disabled_dashboard_widgets(); 380 376 … … 408 404 * @since 1.0.0 409 405 */ 410 public function disable_dashboard_widgets() {406 public function disable_dashboard_widgets(): void { 411 407 $widgets = $this->get_disabled_dashboard_widgets(); 412 408 … … 443 439 * @since 1.0.0 444 440 * 445 * @param array$input Sidebar widgets to disable.446 * @return array447 */ 448 public function sanitize_sidebar_widgets( $input ) {441 * @param mixed[] $input Sidebar widgets to disable. 442 * @return mixed[] 443 */ 444 public function sanitize_sidebar_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4. 449 445 // If there are settings errors the input was already sanitized. 450 446 // See https://core.trac.wordpress.org/ticket/21989. … … 503 499 * @since 1.0.0 504 500 * 505 * @param array$input Dashboards widgets to disable.506 * @return array507 */ 508 public function sanitize_dashboard_widgets( $input ) {501 * @param mixed[] $input Dashboards widgets to disable. 502 * @return mixed[] 503 */ 504 public function sanitize_dashboard_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4. 509 505 // If there are settings errors the input was already sanitized. 510 506 // See https://core.trac.wordpress.org/ticket/21989. … … 563 559 * @since 1.0.0 564 560 */ 565 public function register_settings() {561 public function register_settings(): void { 566 562 register_setting( 567 563 $this->sidebar_widgets_option, … … 573 569 'widget_disable_widget_section', 574 570 __( 'Disable Sidebar Widgets', 'wp-widget-disable' ), 575 function () {571 function (): void { 576 572 echo '<p>'; 577 573 _e( 'Choose the sidebar widgets you would like to disable. Note that developers can still display widgets using PHP.', 'wp-widget-disable' ); … … 598 594 'widget_disable_dashboard_section', 599 595 __( 'Disable Dashboard Widgets', 'wp-widget-disable' ), 600 function () {596 function (): void { 601 597 echo '<p>'; 602 598 _e( 'Choose the dashboard widgets you would like to disable.', 'wp-widget-disable' ); … … 620 616 * @since 1.0.0 621 617 */ 622 public function render_sidebar_checkboxes() {618 public function render_sidebar_checkboxes(): void { 623 619 $widgets = $this->sidebar_widgets; 624 620 … … 668 664 * @since 1.0.0 669 665 */ 670 public function render_dashboard_checkboxes() {666 public function render_dashboard_checkboxes(): void { 671 667 $widgets = $this->get_default_dashboard_widgets(); 672 668 … … 801 797 /** 802 798 * Check if block editor is enabled for widgets. 803 * 804 * @return bool 805 */ 806 public function use_widgets_block_editor() { 799 */ 800 public function use_widgets_block_editor(): bool { 807 801 if ( function_exists( 'wp_use_widgets_block_editor' ) ) { 808 802 return wp_use_widgets_block_editor(); … … 814 808 * Get list of widgets to hide from legacy widget block. 815 809 * 816 * @return array817 */ 818 public function get_widgets_to_hide_from_legacy_widget_block() {810 * @return mixed[] 811 */ 812 public function get_widgets_to_hide_from_legacy_widget_block(): array { 819 813 if ( function_exists( 'get_legacy_widget_block_editor_settings' ) ) { 820 814 return get_legacy_widget_block_editor_settings()['widgetTypesToHideFromLegacyWidgetBlock']; -
wp-widget-disable/tags/3.0.1/vendor/autoload.php
r2887107 r3156633 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit fc830ce5553f798caa2f884b466c6301::getLoader();25 return ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d::getLoader(); -
wp-widget-disable/tags/3.0.1/vendor/composer/ClassLoader.php
r2887107 r3156633 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 482 476 483 477 /** 484 * Returns the currently registered loaders indexed by their corresponding vendor directories.485 * 486 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 487 481 */ 488 482 public static function getRegisteredLoaders() -
wp-widget-disable/tags/3.0.1/vendor/composer/autoload_real.php
r2887107 r3156633 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit fc830ce5553f798caa2f884b466c63015 class ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit fc830ce5553f798caa2f884b466c6301', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit fc830ce5553f798caa2f884b466c6301', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit fc830ce5553f798caa2f884b466c6301::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
wp-widget-disable/tags/3.0.1/vendor/composer/autoload_static.php
r2887107 r3156633 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit fc830ce5553f798caa2f884b466c63017 class ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d 8 8 { 9 9 public static $classMap = array ( … … 15 15 { 16 16 return \Closure::bind(function () use ($loader) { 17 $loader->classMap = ComposerStaticInit fc830ce5553f798caa2f884b466c6301::$classMap;17 $loader->classMap = ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::$classMap; 18 18 19 19 }, null, ClassLoader::class); -
wp-widget-disable/tags/3.0.1/vendor/composer/installed.php
r2887107 r3156633 2 2 'root' => array( 3 3 'name' => 'wearerequired/wp-widget-disable', 4 'pretty_version' => '3.0. 0',5 'version' => '3.0. 0.0',6 'reference' => ' 7b52c2f91b9b31427dbc784cba00965c6e62c7e8',4 'pretty_version' => '3.0.1', 5 'version' => '3.0.1.0', 6 'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'wearerequired/wp-widget-disable' => array( 23 'pretty_version' => '3.0. 0',24 'version' => '3.0. 0.0',25 'reference' => ' 7b52c2f91b9b31427dbc784cba00965c6e62c7e8',23 'pretty_version' => '3.0.1', 24 'version' => '3.0.1.0', 25 'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', -
wp-widget-disable/tags/3.0.1/wp-widget-disable.php
r2887107 r3156633 4 4 * Plugin URI: https://required.com/services/wordpress-plugins/wp-widget-disable/ 5 5 * Description: Disable sidebar and dashboard widgets with an easy to use interface. Simply use the checkboxes provided under <strong>Appearance -> Disable Widgets</strong> and select the widgets you'd like to hide. 6 * Version: 3.0. 06 * Version: 3.0.1 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 12 12 * Text Domain: wp-widget-disable 13 13 * 14 * Copyright (c) 2015-202 3required (email: support@required.ch)14 * Copyright (c) 2015-2024 required (email: support@required.ch) 15 15 * 16 16 * This program is free software; you can redistribute it and/or modify -
wp-widget-disable/trunk/CHANGELOG.md
r2887107 r3156633 5 5 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 6 7 ### [3.0.1] - 2024-09-19 8 9 * Enhancement: Code cleanup, ensuring WordPress 6.6 compatibility. 10 7 11 ### [3.0.0] - 2022-03-17 12 8 13 * Fixed: Replace use of jQuery to avoid deprecation warnings. 9 14 * Changed: Requires at least PHP 7.4 and WordPress 6.0. -
wp-widget-disable/trunk/classes/class-wp-widget-disable.php
r2695407 r3156633 8 8 */ 9 9 class WP_Widget_Disable { 10 /**11 * Plugin version.12 */13 const VERSION = '2.1.0';14 10 15 11 /** … … 56 52 * Adds hooks. 57 53 */ 58 public function add_hooks() {54 public function add_hooks(): void { 59 55 add_action( 'init', [ $this, 'load_textdomain' ] ); 60 56 … … 90 86 * @return string The URL to the plugin directory. 91 87 */ 92 protected function get_url() {88 protected function get_url(): string { 93 89 return plugin_dir_url( __DIR__ ); 94 90 } … … 99 95 * @return string The absolute path to the plugin directory. 100 96 */ 101 protected function get_path() {97 protected function get_path(): string { 102 98 return plugin_dir_path( __DIR__ ); 103 99 } … … 110 106 * @return string The plugin basename. 111 107 */ 112 protected function get_basename() {108 protected function get_basename(): string { 113 109 return plugin_basename( $this->get_path() . 'wp-widget-disable.php' ); 114 110 } … … 117 113 * Initializes the plugin, registers textdomain, etc. 118 114 */ 119 public function load_textdomain() {115 public function load_textdomain(): void { 120 116 load_plugin_textdomain( 'wp-widget-disable' ); 121 117 } … … 126 122 * @since 1.0.0 127 123 */ 128 public function admin_menu() {124 public function admin_menu(): void { 129 125 if ( is_network_admin() ) { 130 126 $this->page_hook = add_submenu_page( … … 156 152 * @since 2.0.0 157 153 */ 158 public function settings_page_load_callback() {154 public function settings_page_load_callback(): void { 159 155 $key = md5( $_SERVER['HTTP_USER_AGENT'] ); 160 156 add_filter( 'pre_site_transient_browser_' . $key, '__return_null' ); … … 171 167 * @since 1.6.0 172 168 */ 173 public function settings_page_callback() {169 public function settings_page_callback(): void { 174 170 include trailingslashit( $this->get_path() ) . 'views/admin.php'; 175 171 } … … 180 176 * @since 1.7.0 181 177 */ 182 public function settings_errors() {178 public function settings_errors(): void { 183 179 settings_errors( 'wp-widget-disable' ); 184 180 } … … 191 187 * @return bool True if settings errors exist, false if not. 192 188 */ 193 public function has_settings_errors() {189 public function has_settings_errors(): bool { 194 190 return count( get_settings_errors( 'wp-widget-disable' ) ) > 0; 195 191 } … … 204 200 * @since 1.9.0 205 201 */ 206 public function save_network_options() {202 public function save_network_options(): void { 207 203 $data = []; 208 204 … … 239 235 * @since 1.0.0 240 236 * 241 * @param array$links Plugin action links.242 * @return array243 */ 244 public function plugin_action_links( array $links ) {237 * @param mixed[] $links Plugin action links. 238 * @return mixed[] 239 */ 240 public function plugin_action_links( array $links ): array { 245 241 $settings_url = add_query_arg( 246 242 [ 'page' => 'wp-widget-disable' ], … … 270 266 * Set the default sidebar widgets. 271 267 */ 272 public function set_default_sidebar_widgets() {268 public function set_default_sidebar_widgets(): void { 273 269 $widgets = []; 274 270 … … 288 284 * Get the default dashboard widgets. 289 285 * 290 * @return arraySidebar widgets.291 */ 292 protected function get_default_dashboard_widgets() {286 * @return mixed[] Sidebar widgets. 287 */ 288 protected function get_default_dashboard_widgets(): array { 293 289 global $wp_meta_boxes; 294 290 … … 342 338 * @since 1.0.0 343 339 */ 344 public function disable_sidebar_widgets() {340 public function disable_sidebar_widgets(): void { 345 341 $widgets = (array) get_option( $this->sidebar_widgets_option, [] ); 346 342 if ( ! empty( $widgets ) ) { … … 356 352 * @since 2.0.0 357 353 * 358 * @return arrayList of disabled widget IDs.359 */ 360 protected function get_disabled_dashboard_widgets() {354 * @return mixed[] List of disabled widget IDs. 355 */ 356 protected function get_disabled_dashboard_widgets(): array { 361 357 $widgets = (array) get_option( $this->dashboard_widgets_option, [] ); 362 358 … … 376 372 * @since 2.0.0 377 373 */ 378 public function disable_dashboard_widgets_with_remote_requests() {374 public function disable_dashboard_widgets_with_remote_requests(): void { 379 375 $widgets = $this->get_disabled_dashboard_widgets(); 380 376 … … 408 404 * @since 1.0.0 409 405 */ 410 public function disable_dashboard_widgets() {406 public function disable_dashboard_widgets(): void { 411 407 $widgets = $this->get_disabled_dashboard_widgets(); 412 408 … … 443 439 * @since 1.0.0 444 440 * 445 * @param array$input Sidebar widgets to disable.446 * @return array447 */ 448 public function sanitize_sidebar_widgets( $input ) {441 * @param mixed[] $input Sidebar widgets to disable. 442 * @return mixed[] 443 */ 444 public function sanitize_sidebar_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4. 449 445 // If there are settings errors the input was already sanitized. 450 446 // See https://core.trac.wordpress.org/ticket/21989. … … 503 499 * @since 1.0.0 504 500 * 505 * @param array$input Dashboards widgets to disable.506 * @return array507 */ 508 public function sanitize_dashboard_widgets( $input ) {501 * @param mixed[] $input Dashboards widgets to disable. 502 * @return mixed[] 503 */ 504 public function sanitize_dashboard_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4. 509 505 // If there are settings errors the input was already sanitized. 510 506 // See https://core.trac.wordpress.org/ticket/21989. … … 563 559 * @since 1.0.0 564 560 */ 565 public function register_settings() {561 public function register_settings(): void { 566 562 register_setting( 567 563 $this->sidebar_widgets_option, … … 573 569 'widget_disable_widget_section', 574 570 __( 'Disable Sidebar Widgets', 'wp-widget-disable' ), 575 function () {571 function (): void { 576 572 echo '<p>'; 577 573 _e( 'Choose the sidebar widgets you would like to disable. Note that developers can still display widgets using PHP.', 'wp-widget-disable' ); … … 598 594 'widget_disable_dashboard_section', 599 595 __( 'Disable Dashboard Widgets', 'wp-widget-disable' ), 600 function () {596 function (): void { 601 597 echo '<p>'; 602 598 _e( 'Choose the dashboard widgets you would like to disable.', 'wp-widget-disable' ); … … 620 616 * @since 1.0.0 621 617 */ 622 public function render_sidebar_checkboxes() {618 public function render_sidebar_checkboxes(): void { 623 619 $widgets = $this->sidebar_widgets; 624 620 … … 668 664 * @since 1.0.0 669 665 */ 670 public function render_dashboard_checkboxes() {666 public function render_dashboard_checkboxes(): void { 671 667 $widgets = $this->get_default_dashboard_widgets(); 672 668 … … 801 797 /** 802 798 * Check if block editor is enabled for widgets. 803 * 804 * @return bool 805 */ 806 public function use_widgets_block_editor() { 799 */ 800 public function use_widgets_block_editor(): bool { 807 801 if ( function_exists( 'wp_use_widgets_block_editor' ) ) { 808 802 return wp_use_widgets_block_editor(); … … 814 808 * Get list of widgets to hide from legacy widget block. 815 809 * 816 * @return array817 */ 818 public function get_widgets_to_hide_from_legacy_widget_block() {810 * @return mixed[] 811 */ 812 public function get_widgets_to_hide_from_legacy_widget_block(): array { 819 813 if ( function_exists( 'get_legacy_widget_block_editor_settings' ) ) { 820 814 return get_legacy_widget_block_editor_settings()['widgetTypesToHideFromLegacyWidgetBlock']; -
wp-widget-disable/trunk/vendor/autoload.php
r2887107 r3156633 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit fc830ce5553f798caa2f884b466c6301::getLoader();25 return ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d::getLoader(); -
wp-widget-disable/trunk/vendor/composer/ClassLoader.php
r2887107 r3156633 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 482 476 483 477 /** 484 * Returns the currently registered loaders indexed by their corresponding vendor directories.485 * 486 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 487 481 */ 488 482 public static function getRegisteredLoaders() -
wp-widget-disable/trunk/vendor/composer/autoload_real.php
r2887107 r3156633 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit fc830ce5553f798caa2f884b466c63015 class ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit fc830ce5553f798caa2f884b466c6301', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit fc830ce5553f798caa2f884b466c6301', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit fc830ce5553f798caa2f884b466c6301::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
wp-widget-disable/trunk/vendor/composer/autoload_static.php
r2887107 r3156633 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit fc830ce5553f798caa2f884b466c63017 class ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d 8 8 { 9 9 public static $classMap = array ( … … 15 15 { 16 16 return \Closure::bind(function () use ($loader) { 17 $loader->classMap = ComposerStaticInit fc830ce5553f798caa2f884b466c6301::$classMap;17 $loader->classMap = ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::$classMap; 18 18 19 19 }, null, ClassLoader::class); -
wp-widget-disable/trunk/vendor/composer/installed.php
r2887107 r3156633 2 2 'root' => array( 3 3 'name' => 'wearerequired/wp-widget-disable', 4 'pretty_version' => '3.0. 0',5 'version' => '3.0. 0.0',6 'reference' => ' 7b52c2f91b9b31427dbc784cba00965c6e62c7e8',4 'pretty_version' => '3.0.1', 5 'version' => '3.0.1.0', 6 'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'wearerequired/wp-widget-disable' => array( 23 'pretty_version' => '3.0. 0',24 'version' => '3.0. 0.0',25 'reference' => ' 7b52c2f91b9b31427dbc784cba00965c6e62c7e8',23 'pretty_version' => '3.0.1', 24 'version' => '3.0.1.0', 25 'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', -
wp-widget-disable/trunk/wp-widget-disable.php
r2887107 r3156633 4 4 * Plugin URI: https://required.com/services/wordpress-plugins/wp-widget-disable/ 5 5 * Description: Disable sidebar and dashboard widgets with an easy to use interface. Simply use the checkboxes provided under <strong>Appearance -> Disable Widgets</strong> and select the widgets you'd like to hide. 6 * Version: 3.0. 06 * Version: 3.0.1 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 12 12 * Text Domain: wp-widget-disable 13 13 * 14 * Copyright (c) 2015-202 3required (email: support@required.ch)14 * Copyright (c) 2015-2024 required (email: support@required.ch) 15 15 * 16 16 * This program is free software; you can redistribute it and/or modify
Note: See TracChangeset
for help on using the changeset viewer.