Changeset 2695407
- Timestamp:
- 03/17/2022 01:21:41 PM (4 years ago)
- Location:
- wp-widget-disable
- Files:
-
- 6 added
- 4 deleted
- 18 edited
- 1 copied
-
tags/2.1.0 (copied) (copied from wp-widget-disable/trunk)
-
tags/2.1.0/CHANGELOG.md (modified) (2 diffs)
-
tags/2.1.0/classes/class-wp-widget-disable.php (modified) (7 diffs)
-
tags/2.1.0/vendor/autoload.php (modified) (1 diff)
-
tags/2.1.0/vendor/composer/ClassLoader.php (modified) (18 diffs)
-
tags/2.1.0/vendor/composer/InstalledVersions.php (added)
-
tags/2.1.0/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/2.1.0/vendor/composer/autoload_real.php (modified) (3 diffs)
-
tags/2.1.0/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/2.1.0/vendor/composer/installed.json (modified) (1 diff)
-
tags/2.1.0/vendor/composer/installed.php (added)
-
tags/2.1.0/vendor/composer/platform_check.php (added)
-
tags/2.1.0/vendor/wearerequired/wp-requirements-check/README.md (deleted)
-
tags/2.1.0/vendor/wearerequired/wp-requirements-check/composer.json (deleted)
-
tags/2.1.0/wp-widget-disable.php (modified) (4 diffs)
-
trunk/CHANGELOG.md (modified) (2 diffs)
-
trunk/classes/class-wp-widget-disable.php (modified) (7 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (18 diffs)
-
trunk/vendor/composer/InstalledVersions.php (added)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.json (modified) (1 diff)
-
trunk/vendor/composer/installed.php (added)
-
trunk/vendor/composer/platform_check.php (added)
-
trunk/vendor/wearerequired/wp-requirements-check/README.md (deleted)
-
trunk/vendor/wearerequired/wp-requirements-check/composer.json (deleted)
-
trunk/wp-widget-disable.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-widget-disable/tags/2.1.0/CHANGELOG.md
r2237194 r2695407 4 4 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 5 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 7 ### [2.1.0] - 2022-03-17 8 9 * Enhancement: Hide disbaled sidebar widgets when widget block editor is enabled. 10 * Changed: Requires at least PHP 5.6 and WordPress 4.7. 6 11 7 12 ## [2.0.0] - 2020-02-02 … … 80 85 81 86 [Unreleased]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...master 87 [2.1.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...2.1.0 82 88 [2.0.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/1.9.0...2.0.0 83 89 [1.9.1]: https://github.com/wearerequired/WP-Widget-Disable/compare/1.9.0...1.9.1 -
wp-widget-disable/tags/2.1.0/classes/class-wp-widget-disable.php
r2237194 r2695407 2 2 /** 3 3 * Holds the main plugin class. 4 *5 * @package WP_Widget_Disable6 4 */ 7 5 … … 13 11 * Plugin version. 14 12 */ 15 const VERSION = '2. 0.0';13 const VERSION = '2.1.0'; 16 14 17 15 /** … … 242 240 * 243 241 * @param array $links Plugin action links. 244 *245 242 * @return array 246 243 */ … … 447 444 * 448 445 * @param array $input Sidebar widgets to disable. 449 *450 446 * @return array 451 447 */ … … 508 504 * 509 505 * @param array $input Dashboards widgets to disable. 510 *511 506 * @return array 512 507 */ … … 638 633 } 639 634 640 $options = (array) get_option( $this->sidebar_widgets_option, [] ); 635 $options = (array) get_option( $this->sidebar_widgets_option, [] ); 636 $widgets_to_hide = $this->get_widgets_to_hide_from_legacy_widget_block(); 637 $use_widgets_block_editor = $this->use_widgets_block_editor(); 641 638 642 639 foreach ( $widgets as $id => $widget_object ) { 640 // Hide widgets if widgets block is enabled. 641 if ( $use_widgets_block_editor && in_array( $widget_object->id_base, $widgets_to_hide, true ) ) { 642 continue; 643 } 643 644 printf( 644 645 '<p><input type="checkbox" id="%1$s" name="%2$s" value="disabled" %3$s> <label for="%1$s">%4$s</label></p>', … … 797 798 <?php 798 799 } 800 801 /** 802 * Check if block editor is enabled for widgets. 803 * 804 * @return bool 805 */ 806 public function use_widgets_block_editor() { 807 if ( function_exists( 'wp_use_widgets_block_editor' ) ) { 808 return wp_use_widgets_block_editor(); 809 } 810 return false; 811 } 812 813 /** 814 * Get list of widgets to hide from legacy widget block. 815 * 816 * @return array 817 */ 818 public function get_widgets_to_hide_from_legacy_widget_block() { 819 if ( function_exists( 'get_legacy_widget_block_editor_settings' ) ) { 820 return get_legacy_widget_block_editor_settings()['widgetTypesToHideFromLegacyWidgetBlock']; 821 } 822 return []; 823 } 799 824 } -
wp-widget-disable/tags/2.1.0/vendor/autoload.php
r2237194 r2695407 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 3b2a2c909c6199de140597783e388f82::getLoader();7 return ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597::getLoader(); -
wp-widget-disable/tags/2.1.0/vendor/composer/ClassLoader.php
r2048125 r2695407 38 38 * @author Fabien Potencier <fabien@symfony.com> 39 39 * @author Jordi Boggiano <j.boggiano@seld.be> 40 * @see http ://www.php-fig.org/psr/psr-0/41 * @see http ://www.php-fig.org/psr/psr-4/40 * @see https://www.php-fig.org/psr/psr-0/ 41 * @see https://www.php-fig.org/psr/psr-4/ 42 42 */ 43 43 class ClassLoader 44 44 { 45 /** @var ?string */ 46 private $vendorDir; 47 45 48 // PSR-4 49 /** 50 * @var array[] 51 * @psalm-var array<string, array<string, int>> 52 */ 46 53 private $prefixLengthsPsr4 = array(); 54 /** 55 * @var array[] 56 * @psalm-var array<string, array<int, string>> 57 */ 47 58 private $prefixDirsPsr4 = array(); 59 /** 60 * @var array[] 61 * @psalm-var array<string, string> 62 */ 48 63 private $fallbackDirsPsr4 = array(); 49 64 50 65 // PSR-0 66 /** 67 * @var array[] 68 * @psalm-var array<string, array<string, string[]>> 69 */ 51 70 private $prefixesPsr0 = array(); 71 /** 72 * @var array[] 73 * @psalm-var array<string, string> 74 */ 52 75 private $fallbackDirsPsr0 = array(); 53 76 77 /** @var bool */ 54 78 private $useIncludePath = false; 79 80 /** 81 * @var string[] 82 * @psalm-var array<string, string> 83 */ 55 84 private $classMap = array(); 85 86 /** @var bool */ 56 87 private $classMapAuthoritative = false; 88 89 /** 90 * @var bool[] 91 * @psalm-var array<string, bool> 92 */ 57 93 private $missingClasses = array(); 94 95 /** @var ?string */ 58 96 private $apcuPrefix; 59 97 98 /** 99 * @var self[] 100 */ 101 private static $registeredLoaders = array(); 102 103 /** 104 * @param ?string $vendorDir 105 */ 106 public function __construct($vendorDir = null) 107 { 108 $this->vendorDir = $vendorDir; 109 } 110 111 /** 112 * @return string[] 113 */ 60 114 public function getPrefixes() 61 115 { 62 116 if (!empty($this->prefixesPsr0)) { 63 return call_user_func_array('array_merge', $this->prefixesPsr0);117 return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); 64 118 } 65 119 … … 67 121 } 68 122 123 /** 124 * @return array[] 125 * @psalm-return array<string, array<int, string>> 126 */ 69 127 public function getPrefixesPsr4() 70 128 { … … 72 130 } 73 131 132 /** 133 * @return array[] 134 * @psalm-return array<string, string> 135 */ 74 136 public function getFallbackDirs() 75 137 { … … 77 139 } 78 140 141 /** 142 * @return array[] 143 * @psalm-return array<string, string> 144 */ 79 145 public function getFallbackDirsPsr4() 80 146 { … … 82 148 } 83 149 150 /** 151 * @return string[] Array of classname => path 152 * @psalm-return array<string, string> 153 */ 84 154 public function getClassMap() 85 155 { … … 88 158 89 159 /** 90 * @param array $classMap Class to filename map 160 * @param string[] $classMap Class to filename map 161 * @psalm-param array<string, string> $classMap 162 * 163 * @return void 91 164 */ 92 165 public function addClassMap(array $classMap) … … 103 176 * appending or prepending to the ones previously set for this prefix. 104 177 * 105 * @param string $prefix The prefix 106 * @param array|string $paths The PSR-0 root directories 107 * @param bool $prepend Whether to prepend the directories 178 * @param string $prefix The prefix 179 * @param string[]|string $paths The PSR-0 root directories 180 * @param bool $prepend Whether to prepend the directories 181 * 182 * @return void 108 183 */ 109 184 public function add($prefix, $paths, $prepend = false) … … 148 223 * appending or prepending to the ones previously set for this namespace. 149 224 * 150 * @param string $prefix The prefix/namespace, with trailing '\\'151 * @param array|string $paths The PSR-4 base directories152 * @param bool $prepend Whether to prepend the directories225 * @param string $prefix The prefix/namespace, with trailing '\\' 226 * @param string[]|string $paths The PSR-4 base directories 227 * @param bool $prepend Whether to prepend the directories 153 228 * 154 229 * @throws \InvalidArgumentException 230 * 231 * @return void 155 232 */ 156 233 public function addPsr4($prefix, $paths, $prepend = false) … … 196 273 * replacing any others previously set for this prefix. 197 274 * 198 * @param string $prefix The prefix 199 * @param array|string $paths The PSR-0 base directories 275 * @param string $prefix The prefix 276 * @param string[]|string $paths The PSR-0 base directories 277 * 278 * @return void 200 279 */ 201 280 public function set($prefix, $paths) … … 212 291 * replacing any others previously set for this namespace. 213 292 * 214 * @param string $prefix The prefix/namespace, with trailing '\\'215 * @param array|string $paths The PSR-4 base directories293 * @param string $prefix The prefix/namespace, with trailing '\\' 294 * @param string[]|string $paths The PSR-4 base directories 216 295 * 217 296 * @throws \InvalidArgumentException 297 * 298 * @return void 218 299 */ 219 300 public function setPsr4($prefix, $paths) … … 235 316 * 236 317 * @param bool $useIncludePath 318 * 319 * @return void 237 320 */ 238 321 public function setUseIncludePath($useIncludePath) … … 257 340 * 258 341 * @param bool $classMapAuthoritative 342 * 343 * @return void 259 344 */ 260 345 public function setClassMapAuthoritative($classMapAuthoritative) … … 277 362 * 278 363 * @param string|null $apcuPrefix 364 * 365 * @return void 279 366 */ 280 367 public function setApcuPrefix($apcuPrefix) … … 297 384 * 298 385 * @param bool $prepend Whether to prepend the autoloader or not 386 * 387 * @return void 299 388 */ 300 389 public function register($prepend = false) 301 390 { 302 391 spl_autoload_register(array($this, 'loadClass'), true, $prepend); 392 393 if (null === $this->vendorDir) { 394 return; 395 } 396 397 if ($prepend) { 398 self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; 399 } else { 400 unset(self::$registeredLoaders[$this->vendorDir]); 401 self::$registeredLoaders[$this->vendorDir] = $this; 402 } 303 403 } 304 404 305 405 /** 306 406 * Unregisters this instance as an autoloader. 407 * 408 * @return void 307 409 */ 308 410 public function unregister() 309 411 { 310 412 spl_autoload_unregister(array($this, 'loadClass')); 413 414 if (null !== $this->vendorDir) { 415 unset(self::$registeredLoaders[$this->vendorDir]); 416 } 311 417 } 312 418 … … 315 421 * 316 422 * @param string $class The name of the class 317 * @return bool|null True if loaded, null otherwise423 * @return true|null True if loaded, null otherwise 318 424 */ 319 425 public function loadClass($class) … … 324 430 return true; 325 431 } 432 433 return null; 326 434 } 327 435 … … 368 476 } 369 477 478 /** 479 * Returns the currently registered loaders indexed by their corresponding vendor directories. 480 * 481 * @return self[] 482 */ 483 public static function getRegisteredLoaders() 484 { 485 return self::$registeredLoaders; 486 } 487 488 /** 489 * @param string $class 490 * @param string $ext 491 * @return string|false 492 */ 370 493 private function findFileWithExtension($class, $ext) 371 494 { … … 439 562 * 440 563 * Prevents access to $this/self from included files. 564 * 565 * @param string $file 566 * @return void 567 * @private 441 568 */ 442 569 function includeFile($file) -
wp-widget-disable/tags/2.1.0/vendor/composer/autoload_classmap.php
r1487873 r2695407 7 7 8 8 return array( 9 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 9 10 'WP_Requirements_Check' => $vendorDir . '/wearerequired/wp-requirements-check/WP_Requirements_Check.php', 10 11 ); -
wp-widget-disable/tags/2.1.0/vendor/composer/autoload_real.php
r2237194 r2695407 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 3b2a2c909c6199de140597783e388f825 class ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597 6 6 { 7 7 private static $loader; … … 14 14 } 15 15 16 /** 17 * @return \Composer\Autoload\ClassLoader 18 */ 16 19 public static function getLoader() 17 20 { … … 20 23 } 21 24 22 spl_autoload_register(array('ComposerAutoloaderInit3b2a2c909c6199de140597783e388f82', 'loadClassLoader'), true, true); 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit3b2a2c909c6199de140597783e388f82', 'loadClassLoader')); 25 require __DIR__ . '/platform_check.php'; 26 27 spl_autoload_register(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader'), true, true); 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader')); 25 30 26 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 32 if ($useStaticLoader) { 28 require _once__DIR__ . '/autoload_static.php';33 require __DIR__ . '/autoload_static.php'; 29 34 30 call_user_func(\Composer\Autoload\ComposerStaticInit 3b2a2c909c6199de140597783e388f82::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597::getInitializer($loader)); 31 36 } else { 32 37 $map = require __DIR__ . '/autoload_namespaces.php'; -
wp-widget-disable/tags/2.1.0/vendor/composer/autoload_static.php
r2237194 r2695407 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 3b2a2c909c6199de140597783e388f827 class ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597 8 8 { 9 9 public static $classMap = array ( 10 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 10 11 'WP_Requirements_Check' => __DIR__ . '/..' . '/wearerequired/wp-requirements-check/WP_Requirements_Check.php', 11 12 ); … … 14 15 { 15 16 return \Closure::bind(function () use ($loader) { 16 $loader->classMap = ComposerStaticInit 3b2a2c909c6199de140597783e388f82::$classMap;17 $loader->classMap = ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597::$classMap; 17 18 18 19 }, null, ClassLoader::class); -
wp-widget-disable/tags/2.1.0/vendor/composer/installed.json
r2048125 r2695407 1 [ 2 { 3 "name": "wearerequired/wp-requirements-check", 4 "version": "1.1.0", 5 "version_normalized": "1.1.0.0", 6 "source": { 7 "type": "git", 8 "url": "https://github.com/wearerequired/wp-requirements-check.git", 9 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812" 10 }, 11 "dist": { 12 "type": "zip", 13 "url": "https://api.github.com/repos/wearerequired/wp-requirements-check/zipball/82b8a6c4b953f59e7e534df2d4287e34af950812", 14 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812", 15 "shasum": "" 16 }, 17 "time": "2019-03-11T11:11:33+00:00", 18 "type": "library", 19 "installation-source": "dist", 20 "autoload": { 21 "classmap": [ 22 "WP_Requirements_Check.php" 23 ] 24 }, 25 "notification-url": "https://packagist.org/downloads/", 26 "license": [ 27 "GPL-2.0+" 28 ], 29 "authors": [ 30 { 31 "name": "Pascal Birchler", 32 "email": "pascal@required.ch", 33 "role": "Developer" 1 { 2 "packages": [ 3 { 4 "name": "wearerequired/wp-requirements-check", 5 "version": "1.1.0", 6 "version_normalized": "1.1.0.0", 7 "source": { 8 "type": "git", 9 "url": "https://github.com/wearerequired/wp-requirements-check.git", 10 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812" 34 11 }, 35 {36 " name": "required",37 " email": "support@required.ch",38 " homepage": "https://required.com",39 " role": "Company"12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/wearerequired/wp-requirements-check/zipball/82b8a6c4b953f59e7e534df2d4287e34af950812", 15 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812", 16 "shasum": "" 40 17 }, 41 { 42 "name": "Ulrich Pogson", 43 "email": "ulrich@required.ch", 44 "role": "Developer" 45 } 46 ], 47 "description": "Simple requirements checking class", 48 "keywords": [ 49 "requirements", 50 "wordpress" 51 ] 52 } 53 ] 18 "time": "2019-03-11T11:11:33+00:00", 19 "type": "library", 20 "installation-source": "dist", 21 "autoload": { 22 "classmap": [ 23 "WP_Requirements_Check.php" 24 ] 25 }, 26 "notification-url": "https://packagist.org/downloads/", 27 "license": [ 28 "GPL-2.0+" 29 ], 30 "authors": [ 31 { 32 "name": "Pascal Birchler", 33 "email": "pascal@required.ch", 34 "role": "Developer" 35 }, 36 { 37 "name": "required", 38 "email": "support@required.ch", 39 "homepage": "https://required.com", 40 "role": "Company" 41 }, 42 { 43 "name": "Ulrich Pogson", 44 "email": "ulrich@required.ch", 45 "role": "Developer" 46 } 47 ], 48 "description": "Simple requirements checking class", 49 "keywords": [ 50 "requirements", 51 "wordpress" 52 ], 53 "support": { 54 "issues": "https://github.com/wearerequired/wp-requirements-check/issues", 55 "source": "https://github.com/wearerequired/wp-requirements-check/tree/master" 56 }, 57 "install-path": "../wearerequired/wp-requirements-check" 58 } 59 ], 60 "dev": false, 61 "dev-package-names": [] 62 } -
wp-widget-disable/tags/2.1.0/wp-widget-disable.php
r2237194 r2695407 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: 2. 0.06 * Version: 2.1.0 7 7 * Author: required 8 8 * Author URI: https://required.com … … 10 10 * Text Domain: wp-widget-disable 11 11 * 12 * Copyright (c) 2015-202 0required (email: support@required.ch)12 * Copyright (c) 2015-2022 required (email: support@required.ch) 13 13 * 14 14 * This program is free software; you can redistribute it and/or modify … … 25 25 * along with this program; if not, write to the Free Software 26 26 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 *28 * @package WP_Widget_Disable29 27 */ 30 28 … … 39 37 array( 40 38 'title' => 'WP Widget Disable', 41 'php' => '5. 4',42 'wp' => '4. 0',39 'php' => '5.6', 40 'wp' => '4.7', 43 41 'file' => __FILE__, 44 42 ) -
wp-widget-disable/trunk/CHANGELOG.md
r2237194 r2695407 4 4 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 5 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 7 ### [2.1.0] - 2022-03-17 8 9 * Enhancement: Hide disbaled sidebar widgets when widget block editor is enabled. 10 * Changed: Requires at least PHP 5.6 and WordPress 4.7. 6 11 7 12 ## [2.0.0] - 2020-02-02 … … 80 85 81 86 [Unreleased]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...master 87 [2.1.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...2.1.0 82 88 [2.0.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/1.9.0...2.0.0 83 89 [1.9.1]: https://github.com/wearerequired/WP-Widget-Disable/compare/1.9.0...1.9.1 -
wp-widget-disable/trunk/classes/class-wp-widget-disable.php
r2237194 r2695407 2 2 /** 3 3 * Holds the main plugin class. 4 *5 * @package WP_Widget_Disable6 4 */ 7 5 … … 13 11 * Plugin version. 14 12 */ 15 const VERSION = '2. 0.0';13 const VERSION = '2.1.0'; 16 14 17 15 /** … … 242 240 * 243 241 * @param array $links Plugin action links. 244 *245 242 * @return array 246 243 */ … … 447 444 * 448 445 * @param array $input Sidebar widgets to disable. 449 *450 446 * @return array 451 447 */ … … 508 504 * 509 505 * @param array $input Dashboards widgets to disable. 510 *511 506 * @return array 512 507 */ … … 638 633 } 639 634 640 $options = (array) get_option( $this->sidebar_widgets_option, [] ); 635 $options = (array) get_option( $this->sidebar_widgets_option, [] ); 636 $widgets_to_hide = $this->get_widgets_to_hide_from_legacy_widget_block(); 637 $use_widgets_block_editor = $this->use_widgets_block_editor(); 641 638 642 639 foreach ( $widgets as $id => $widget_object ) { 640 // Hide widgets if widgets block is enabled. 641 if ( $use_widgets_block_editor && in_array( $widget_object->id_base, $widgets_to_hide, true ) ) { 642 continue; 643 } 643 644 printf( 644 645 '<p><input type="checkbox" id="%1$s" name="%2$s" value="disabled" %3$s> <label for="%1$s">%4$s</label></p>', … … 797 798 <?php 798 799 } 800 801 /** 802 * Check if block editor is enabled for widgets. 803 * 804 * @return bool 805 */ 806 public function use_widgets_block_editor() { 807 if ( function_exists( 'wp_use_widgets_block_editor' ) ) { 808 return wp_use_widgets_block_editor(); 809 } 810 return false; 811 } 812 813 /** 814 * Get list of widgets to hide from legacy widget block. 815 * 816 * @return array 817 */ 818 public function get_widgets_to_hide_from_legacy_widget_block() { 819 if ( function_exists( 'get_legacy_widget_block_editor_settings' ) ) { 820 return get_legacy_widget_block_editor_settings()['widgetTypesToHideFromLegacyWidgetBlock']; 821 } 822 return []; 823 } 799 824 } -
wp-widget-disable/trunk/vendor/autoload.php
r2237194 r2695407 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 3b2a2c909c6199de140597783e388f82::getLoader();7 return ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597::getLoader(); -
wp-widget-disable/trunk/vendor/composer/ClassLoader.php
r2048125 r2695407 38 38 * @author Fabien Potencier <fabien@symfony.com> 39 39 * @author Jordi Boggiano <j.boggiano@seld.be> 40 * @see http ://www.php-fig.org/psr/psr-0/41 * @see http ://www.php-fig.org/psr/psr-4/40 * @see https://www.php-fig.org/psr/psr-0/ 41 * @see https://www.php-fig.org/psr/psr-4/ 42 42 */ 43 43 class ClassLoader 44 44 { 45 /** @var ?string */ 46 private $vendorDir; 47 45 48 // PSR-4 49 /** 50 * @var array[] 51 * @psalm-var array<string, array<string, int>> 52 */ 46 53 private $prefixLengthsPsr4 = array(); 54 /** 55 * @var array[] 56 * @psalm-var array<string, array<int, string>> 57 */ 47 58 private $prefixDirsPsr4 = array(); 59 /** 60 * @var array[] 61 * @psalm-var array<string, string> 62 */ 48 63 private $fallbackDirsPsr4 = array(); 49 64 50 65 // PSR-0 66 /** 67 * @var array[] 68 * @psalm-var array<string, array<string, string[]>> 69 */ 51 70 private $prefixesPsr0 = array(); 71 /** 72 * @var array[] 73 * @psalm-var array<string, string> 74 */ 52 75 private $fallbackDirsPsr0 = array(); 53 76 77 /** @var bool */ 54 78 private $useIncludePath = false; 79 80 /** 81 * @var string[] 82 * @psalm-var array<string, string> 83 */ 55 84 private $classMap = array(); 85 86 /** @var bool */ 56 87 private $classMapAuthoritative = false; 88 89 /** 90 * @var bool[] 91 * @psalm-var array<string, bool> 92 */ 57 93 private $missingClasses = array(); 94 95 /** @var ?string */ 58 96 private $apcuPrefix; 59 97 98 /** 99 * @var self[] 100 */ 101 private static $registeredLoaders = array(); 102 103 /** 104 * @param ?string $vendorDir 105 */ 106 public function __construct($vendorDir = null) 107 { 108 $this->vendorDir = $vendorDir; 109 } 110 111 /** 112 * @return string[] 113 */ 60 114 public function getPrefixes() 61 115 { 62 116 if (!empty($this->prefixesPsr0)) { 63 return call_user_func_array('array_merge', $this->prefixesPsr0);117 return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); 64 118 } 65 119 … … 67 121 } 68 122 123 /** 124 * @return array[] 125 * @psalm-return array<string, array<int, string>> 126 */ 69 127 public function getPrefixesPsr4() 70 128 { … … 72 130 } 73 131 132 /** 133 * @return array[] 134 * @psalm-return array<string, string> 135 */ 74 136 public function getFallbackDirs() 75 137 { … … 77 139 } 78 140 141 /** 142 * @return array[] 143 * @psalm-return array<string, string> 144 */ 79 145 public function getFallbackDirsPsr4() 80 146 { … … 82 148 } 83 149 150 /** 151 * @return string[] Array of classname => path 152 * @psalm-return array<string, string> 153 */ 84 154 public function getClassMap() 85 155 { … … 88 158 89 159 /** 90 * @param array $classMap Class to filename map 160 * @param string[] $classMap Class to filename map 161 * @psalm-param array<string, string> $classMap 162 * 163 * @return void 91 164 */ 92 165 public function addClassMap(array $classMap) … … 103 176 * appending or prepending to the ones previously set for this prefix. 104 177 * 105 * @param string $prefix The prefix 106 * @param array|string $paths The PSR-0 root directories 107 * @param bool $prepend Whether to prepend the directories 178 * @param string $prefix The prefix 179 * @param string[]|string $paths The PSR-0 root directories 180 * @param bool $prepend Whether to prepend the directories 181 * 182 * @return void 108 183 */ 109 184 public function add($prefix, $paths, $prepend = false) … … 148 223 * appending or prepending to the ones previously set for this namespace. 149 224 * 150 * @param string $prefix The prefix/namespace, with trailing '\\'151 * @param array|string $paths The PSR-4 base directories152 * @param bool $prepend Whether to prepend the directories225 * @param string $prefix The prefix/namespace, with trailing '\\' 226 * @param string[]|string $paths The PSR-4 base directories 227 * @param bool $prepend Whether to prepend the directories 153 228 * 154 229 * @throws \InvalidArgumentException 230 * 231 * @return void 155 232 */ 156 233 public function addPsr4($prefix, $paths, $prepend = false) … … 196 273 * replacing any others previously set for this prefix. 197 274 * 198 * @param string $prefix The prefix 199 * @param array|string $paths The PSR-0 base directories 275 * @param string $prefix The prefix 276 * @param string[]|string $paths The PSR-0 base directories 277 * 278 * @return void 200 279 */ 201 280 public function set($prefix, $paths) … … 212 291 * replacing any others previously set for this namespace. 213 292 * 214 * @param string $prefix The prefix/namespace, with trailing '\\'215 * @param array|string $paths The PSR-4 base directories293 * @param string $prefix The prefix/namespace, with trailing '\\' 294 * @param string[]|string $paths The PSR-4 base directories 216 295 * 217 296 * @throws \InvalidArgumentException 297 * 298 * @return void 218 299 */ 219 300 public function setPsr4($prefix, $paths) … … 235 316 * 236 317 * @param bool $useIncludePath 318 * 319 * @return void 237 320 */ 238 321 public function setUseIncludePath($useIncludePath) … … 257 340 * 258 341 * @param bool $classMapAuthoritative 342 * 343 * @return void 259 344 */ 260 345 public function setClassMapAuthoritative($classMapAuthoritative) … … 277 362 * 278 363 * @param string|null $apcuPrefix 364 * 365 * @return void 279 366 */ 280 367 public function setApcuPrefix($apcuPrefix) … … 297 384 * 298 385 * @param bool $prepend Whether to prepend the autoloader or not 386 * 387 * @return void 299 388 */ 300 389 public function register($prepend = false) 301 390 { 302 391 spl_autoload_register(array($this, 'loadClass'), true, $prepend); 392 393 if (null === $this->vendorDir) { 394 return; 395 } 396 397 if ($prepend) { 398 self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; 399 } else { 400 unset(self::$registeredLoaders[$this->vendorDir]); 401 self::$registeredLoaders[$this->vendorDir] = $this; 402 } 303 403 } 304 404 305 405 /** 306 406 * Unregisters this instance as an autoloader. 407 * 408 * @return void 307 409 */ 308 410 public function unregister() 309 411 { 310 412 spl_autoload_unregister(array($this, 'loadClass')); 413 414 if (null !== $this->vendorDir) { 415 unset(self::$registeredLoaders[$this->vendorDir]); 416 } 311 417 } 312 418 … … 315 421 * 316 422 * @param string $class The name of the class 317 * @return bool|null True if loaded, null otherwise423 * @return true|null True if loaded, null otherwise 318 424 */ 319 425 public function loadClass($class) … … 324 430 return true; 325 431 } 432 433 return null; 326 434 } 327 435 … … 368 476 } 369 477 478 /** 479 * Returns the currently registered loaders indexed by their corresponding vendor directories. 480 * 481 * @return self[] 482 */ 483 public static function getRegisteredLoaders() 484 { 485 return self::$registeredLoaders; 486 } 487 488 /** 489 * @param string $class 490 * @param string $ext 491 * @return string|false 492 */ 370 493 private function findFileWithExtension($class, $ext) 371 494 { … … 439 562 * 440 563 * Prevents access to $this/self from included files. 564 * 565 * @param string $file 566 * @return void 567 * @private 441 568 */ 442 569 function includeFile($file) -
wp-widget-disable/trunk/vendor/composer/autoload_classmap.php
r1487873 r2695407 7 7 8 8 return array( 9 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 9 10 'WP_Requirements_Check' => $vendorDir . '/wearerequired/wp-requirements-check/WP_Requirements_Check.php', 10 11 ); -
wp-widget-disable/trunk/vendor/composer/autoload_real.php
r2237194 r2695407 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 3b2a2c909c6199de140597783e388f825 class ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597 6 6 { 7 7 private static $loader; … … 14 14 } 15 15 16 /** 17 * @return \Composer\Autoload\ClassLoader 18 */ 16 19 public static function getLoader() 17 20 { … … 20 23 } 21 24 22 spl_autoload_register(array('ComposerAutoloaderInit3b2a2c909c6199de140597783e388f82', 'loadClassLoader'), true, true); 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit3b2a2c909c6199de140597783e388f82', 'loadClassLoader')); 25 require __DIR__ . '/platform_check.php'; 26 27 spl_autoload_register(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader'), true, true); 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader')); 25 30 26 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 32 if ($useStaticLoader) { 28 require _once__DIR__ . '/autoload_static.php';33 require __DIR__ . '/autoload_static.php'; 29 34 30 call_user_func(\Composer\Autoload\ComposerStaticInit 3b2a2c909c6199de140597783e388f82::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597::getInitializer($loader)); 31 36 } else { 32 37 $map = require __DIR__ . '/autoload_namespaces.php'; -
wp-widget-disable/trunk/vendor/composer/autoload_static.php
r2237194 r2695407 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 3b2a2c909c6199de140597783e388f827 class ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597 8 8 { 9 9 public static $classMap = array ( 10 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 10 11 'WP_Requirements_Check' => __DIR__ . '/..' . '/wearerequired/wp-requirements-check/WP_Requirements_Check.php', 11 12 ); … … 14 15 { 15 16 return \Closure::bind(function () use ($loader) { 16 $loader->classMap = ComposerStaticInit 3b2a2c909c6199de140597783e388f82::$classMap;17 $loader->classMap = ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597::$classMap; 17 18 18 19 }, null, ClassLoader::class); -
wp-widget-disable/trunk/vendor/composer/installed.json
r2048125 r2695407 1 [ 2 { 3 "name": "wearerequired/wp-requirements-check", 4 "version": "1.1.0", 5 "version_normalized": "1.1.0.0", 6 "source": { 7 "type": "git", 8 "url": "https://github.com/wearerequired/wp-requirements-check.git", 9 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812" 10 }, 11 "dist": { 12 "type": "zip", 13 "url": "https://api.github.com/repos/wearerequired/wp-requirements-check/zipball/82b8a6c4b953f59e7e534df2d4287e34af950812", 14 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812", 15 "shasum": "" 16 }, 17 "time": "2019-03-11T11:11:33+00:00", 18 "type": "library", 19 "installation-source": "dist", 20 "autoload": { 21 "classmap": [ 22 "WP_Requirements_Check.php" 23 ] 24 }, 25 "notification-url": "https://packagist.org/downloads/", 26 "license": [ 27 "GPL-2.0+" 28 ], 29 "authors": [ 30 { 31 "name": "Pascal Birchler", 32 "email": "pascal@required.ch", 33 "role": "Developer" 1 { 2 "packages": [ 3 { 4 "name": "wearerequired/wp-requirements-check", 5 "version": "1.1.0", 6 "version_normalized": "1.1.0.0", 7 "source": { 8 "type": "git", 9 "url": "https://github.com/wearerequired/wp-requirements-check.git", 10 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812" 34 11 }, 35 {36 " name": "required",37 " email": "support@required.ch",38 " homepage": "https://required.com",39 " role": "Company"12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/wearerequired/wp-requirements-check/zipball/82b8a6c4b953f59e7e534df2d4287e34af950812", 15 "reference": "82b8a6c4b953f59e7e534df2d4287e34af950812", 16 "shasum": "" 40 17 }, 41 { 42 "name": "Ulrich Pogson", 43 "email": "ulrich@required.ch", 44 "role": "Developer" 45 } 46 ], 47 "description": "Simple requirements checking class", 48 "keywords": [ 49 "requirements", 50 "wordpress" 51 ] 52 } 53 ] 18 "time": "2019-03-11T11:11:33+00:00", 19 "type": "library", 20 "installation-source": "dist", 21 "autoload": { 22 "classmap": [ 23 "WP_Requirements_Check.php" 24 ] 25 }, 26 "notification-url": "https://packagist.org/downloads/", 27 "license": [ 28 "GPL-2.0+" 29 ], 30 "authors": [ 31 { 32 "name": "Pascal Birchler", 33 "email": "pascal@required.ch", 34 "role": "Developer" 35 }, 36 { 37 "name": "required", 38 "email": "support@required.ch", 39 "homepage": "https://required.com", 40 "role": "Company" 41 }, 42 { 43 "name": "Ulrich Pogson", 44 "email": "ulrich@required.ch", 45 "role": "Developer" 46 } 47 ], 48 "description": "Simple requirements checking class", 49 "keywords": [ 50 "requirements", 51 "wordpress" 52 ], 53 "support": { 54 "issues": "https://github.com/wearerequired/wp-requirements-check/issues", 55 "source": "https://github.com/wearerequired/wp-requirements-check/tree/master" 56 }, 57 "install-path": "../wearerequired/wp-requirements-check" 58 } 59 ], 60 "dev": false, 61 "dev-package-names": [] 62 } -
wp-widget-disable/trunk/wp-widget-disable.php
r2237194 r2695407 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: 2. 0.06 * Version: 2.1.0 7 7 * Author: required 8 8 * Author URI: https://required.com … … 10 10 * Text Domain: wp-widget-disable 11 11 * 12 * Copyright (c) 2015-202 0required (email: support@required.ch)12 * Copyright (c) 2015-2022 required (email: support@required.ch) 13 13 * 14 14 * This program is free software; you can redistribute it and/or modify … … 25 25 * along with this program; if not, write to the Free Software 26 26 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 *28 * @package WP_Widget_Disable29 27 */ 30 28 … … 39 37 array( 40 38 'title' => 'WP Widget Disable', 41 'php' => '5. 4',42 'wp' => '4. 0',39 'php' => '5.6', 40 'wp' => '4.7', 43 41 'file' => __FILE__, 44 42 )
Note: See TracChangeset
for help on using the changeset viewer.