├── composer.json ├── composer.lock ├── playground-embedder.php └── readme.txt /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "joostdevalk/fewer-tags", 3 | "description": "Plugin that redirects tag pages to the home page if they contain fewer than a specified number of posts.", 4 | "type": "wordpress-plugin", 5 | "license": "GPL 3+", 6 | "authors": [ 7 | { 8 | "name": "Joost de Valk", 9 | "email": "joost@joost.blog" 10 | } 11 | ], 12 | "require-dev": { 13 | "wp-coding-standards/wpcs": "^3.0", 14 | "phpcompatibility/phpcompatibility-wp": "^2.1" 15 | }, 16 | "prefer-stable": true, 17 | "config": { 18 | "allow-plugins": { 19 | "dealerdirect/phpcodesniffer-composer-installer": true 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "4d70406d001ed9fb06850afd8ef8fdc8", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "dealerdirect/phpcodesniffer-composer-installer", 12 | "version": "v1.0.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/PHPCSStandards/composer-installer.git", 16 | "reference": "4be43904336affa5c2f70744a348312336afd0da" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", 21 | "reference": "4be43904336affa5c2f70744a348312336afd0da", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "composer-plugin-api": "^1.0 || ^2.0", 26 | "php": ">=5.4", 27 | "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" 28 | }, 29 | "require-dev": { 30 | "composer/composer": "*", 31 | "ext-json": "*", 32 | "ext-zip": "*", 33 | "php-parallel-lint/php-parallel-lint": "^1.3.1", 34 | "phpcompatibility/php-compatibility": "^9.0", 35 | "yoast/phpunit-polyfills": "^1.0" 36 | }, 37 | "type": "composer-plugin", 38 | "extra": { 39 | "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 40 | }, 41 | "autoload": { 42 | "psr-4": { 43 | "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 44 | } 45 | }, 46 | "notification-url": "https://packagist.org/downloads/", 47 | "license": [ 48 | "MIT" 49 | ], 50 | "authors": [ 51 | { 52 | "name": "Franck Nijhof", 53 | "email": "franck.nijhof@dealerdirect.com", 54 | "homepage": "http://www.frenck.nl", 55 | "role": "Developer / IT Manager" 56 | }, 57 | { 58 | "name": "Contributors", 59 | "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" 60 | } 61 | ], 62 | "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 63 | "homepage": "http://www.dealerdirect.com", 64 | "keywords": [ 65 | "PHPCodeSniffer", 66 | "PHP_CodeSniffer", 67 | "code quality", 68 | "codesniffer", 69 | "composer", 70 | "installer", 71 | "phpcbf", 72 | "phpcs", 73 | "plugin", 74 | "qa", 75 | "quality", 76 | "standard", 77 | "standards", 78 | "style guide", 79 | "stylecheck", 80 | "tests" 81 | ], 82 | "support": { 83 | "issues": "https://github.com/PHPCSStandards/composer-installer/issues", 84 | "source": "https://github.com/PHPCSStandards/composer-installer" 85 | }, 86 | "time": "2023-01-05T11:28:13+00:00" 87 | }, 88 | { 89 | "name": "phpcompatibility/php-compatibility", 90 | "version": "9.3.5", 91 | "source": { 92 | "type": "git", 93 | "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 94 | "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 95 | }, 96 | "dist": { 97 | "type": "zip", 98 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 99 | "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 100 | "shasum": "" 101 | }, 102 | "require": { 103 | "php": ">=5.3", 104 | "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 105 | }, 106 | "conflict": { 107 | "squizlabs/php_codesniffer": "2.6.2" 108 | }, 109 | "require-dev": { 110 | "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 111 | }, 112 | "suggest": { 113 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 114 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 115 | }, 116 | "type": "phpcodesniffer-standard", 117 | "notification-url": "https://packagist.org/downloads/", 118 | "license": [ 119 | "LGPL-3.0-or-later" 120 | ], 121 | "authors": [ 122 | { 123 | "name": "Wim Godden", 124 | "homepage": "https://github.com/wimg", 125 | "role": "lead" 126 | }, 127 | { 128 | "name": "Juliette Reinders Folmer", 129 | "homepage": "https://github.com/jrfnl", 130 | "role": "lead" 131 | }, 132 | { 133 | "name": "Contributors", 134 | "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 135 | } 136 | ], 137 | "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 138 | "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 139 | "keywords": [ 140 | "compatibility", 141 | "phpcs", 142 | "standards" 143 | ], 144 | "support": { 145 | "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", 146 | "source": "https://github.com/PHPCompatibility/PHPCompatibility" 147 | }, 148 | "time": "2019-12-27T09:44:58+00:00" 149 | }, 150 | { 151 | "name": "phpcompatibility/phpcompatibility-paragonie", 152 | "version": "1.3.2", 153 | "source": { 154 | "type": "git", 155 | "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", 156 | "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" 157 | }, 158 | "dist": { 159 | "type": "zip", 160 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", 161 | "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", 162 | "shasum": "" 163 | }, 164 | "require": { 165 | "phpcompatibility/php-compatibility": "^9.0" 166 | }, 167 | "require-dev": { 168 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7", 169 | "paragonie/random_compat": "dev-master", 170 | "paragonie/sodium_compat": "dev-master" 171 | }, 172 | "suggest": { 173 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 174 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 175 | }, 176 | "type": "phpcodesniffer-standard", 177 | "notification-url": "https://packagist.org/downloads/", 178 | "license": [ 179 | "LGPL-3.0-or-later" 180 | ], 181 | "authors": [ 182 | { 183 | "name": "Wim Godden", 184 | "role": "lead" 185 | }, 186 | { 187 | "name": "Juliette Reinders Folmer", 188 | "role": "lead" 189 | } 190 | ], 191 | "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", 192 | "homepage": "http://phpcompatibility.com/", 193 | "keywords": [ 194 | "compatibility", 195 | "paragonie", 196 | "phpcs", 197 | "polyfill", 198 | "standards", 199 | "static analysis" 200 | ], 201 | "support": { 202 | "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", 203 | "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" 204 | }, 205 | "time": "2022-10-25T01:46:02+00:00" 206 | }, 207 | { 208 | "name": "phpcompatibility/phpcompatibility-wp", 209 | "version": "2.1.4", 210 | "source": { 211 | "type": "git", 212 | "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", 213 | "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" 214 | }, 215 | "dist": { 216 | "type": "zip", 217 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", 218 | "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", 219 | "shasum": "" 220 | }, 221 | "require": { 222 | "phpcompatibility/php-compatibility": "^9.0", 223 | "phpcompatibility/phpcompatibility-paragonie": "^1.0" 224 | }, 225 | "require-dev": { 226 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7" 227 | }, 228 | "suggest": { 229 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 230 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 231 | }, 232 | "type": "phpcodesniffer-standard", 233 | "notification-url": "https://packagist.org/downloads/", 234 | "license": [ 235 | "LGPL-3.0-or-later" 236 | ], 237 | "authors": [ 238 | { 239 | "name": "Wim Godden", 240 | "role": "lead" 241 | }, 242 | { 243 | "name": "Juliette Reinders Folmer", 244 | "role": "lead" 245 | } 246 | ], 247 | "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", 248 | "homepage": "http://phpcompatibility.com/", 249 | "keywords": [ 250 | "compatibility", 251 | "phpcs", 252 | "standards", 253 | "static analysis", 254 | "wordpress" 255 | ], 256 | "support": { 257 | "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", 258 | "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" 259 | }, 260 | "time": "2022-10-24T09:00:36+00:00" 261 | }, 262 | { 263 | "name": "phpcsstandards/phpcsextra", 264 | "version": "1.1.2", 265 | "source": { 266 | "type": "git", 267 | "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", 268 | "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" 269 | }, 270 | "dist": { 271 | "type": "zip", 272 | "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", 273 | "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", 274 | "shasum": "" 275 | }, 276 | "require": { 277 | "php": ">=5.4", 278 | "phpcsstandards/phpcsutils": "^1.0.8", 279 | "squizlabs/php_codesniffer": "^3.7.1" 280 | }, 281 | "require-dev": { 282 | "php-parallel-lint/php-console-highlighter": "^1.0", 283 | "php-parallel-lint/php-parallel-lint": "^1.3.2", 284 | "phpcsstandards/phpcsdevcs": "^1.1.6", 285 | "phpcsstandards/phpcsdevtools": "^1.2.1", 286 | "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" 287 | }, 288 | "type": "phpcodesniffer-standard", 289 | "extra": { 290 | "branch-alias": { 291 | "dev-stable": "1.x-dev", 292 | "dev-develop": "1.x-dev" 293 | } 294 | }, 295 | "notification-url": "https://packagist.org/downloads/", 296 | "license": [ 297 | "LGPL-3.0-or-later" 298 | ], 299 | "authors": [ 300 | { 301 | "name": "Juliette Reinders Folmer", 302 | "homepage": "https://github.com/jrfnl", 303 | "role": "lead" 304 | }, 305 | { 306 | "name": "Contributors", 307 | "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" 308 | } 309 | ], 310 | "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", 311 | "keywords": [ 312 | "PHP_CodeSniffer", 313 | "phpcbf", 314 | "phpcodesniffer-standard", 315 | "phpcs", 316 | "standards", 317 | "static analysis" 318 | ], 319 | "support": { 320 | "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", 321 | "source": "https://github.com/PHPCSStandards/PHPCSExtra" 322 | }, 323 | "time": "2023-09-20T22:06:18+00:00" 324 | }, 325 | { 326 | "name": "phpcsstandards/phpcsutils", 327 | "version": "1.0.8", 328 | "source": { 329 | "type": "git", 330 | "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", 331 | "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" 332 | }, 333 | "dist": { 334 | "type": "zip", 335 | "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", 336 | "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", 337 | "shasum": "" 338 | }, 339 | "require": { 340 | "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", 341 | "php": ">=5.4", 342 | "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" 343 | }, 344 | "require-dev": { 345 | "ext-filter": "*", 346 | "php-parallel-lint/php-console-highlighter": "^1.0", 347 | "php-parallel-lint/php-parallel-lint": "^1.3.2", 348 | "phpcsstandards/phpcsdevcs": "^1.1.6", 349 | "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" 350 | }, 351 | "type": "phpcodesniffer-standard", 352 | "extra": { 353 | "branch-alias": { 354 | "dev-stable": "1.x-dev", 355 | "dev-develop": "1.x-dev" 356 | } 357 | }, 358 | "autoload": { 359 | "classmap": [ 360 | "PHPCSUtils/" 361 | ] 362 | }, 363 | "notification-url": "https://packagist.org/downloads/", 364 | "license": [ 365 | "LGPL-3.0-or-later" 366 | ], 367 | "authors": [ 368 | { 369 | "name": "Juliette Reinders Folmer", 370 | "homepage": "https://github.com/jrfnl", 371 | "role": "lead" 372 | }, 373 | { 374 | "name": "Contributors", 375 | "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" 376 | } 377 | ], 378 | "description": "A suite of utility functions for use with PHP_CodeSniffer", 379 | "homepage": "https://phpcsutils.com/", 380 | "keywords": [ 381 | "PHP_CodeSniffer", 382 | "phpcbf", 383 | "phpcodesniffer-standard", 384 | "phpcs", 385 | "phpcs3", 386 | "standards", 387 | "static analysis", 388 | "tokens", 389 | "utility" 390 | ], 391 | "support": { 392 | "docs": "https://phpcsutils.com/", 393 | "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", 394 | "source": "https://github.com/PHPCSStandards/PHPCSUtils" 395 | }, 396 | "time": "2023-07-16T21:39:41+00:00" 397 | }, 398 | { 399 | "name": "squizlabs/php_codesniffer", 400 | "version": "3.7.2", 401 | "source": { 402 | "type": "git", 403 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 404 | "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" 405 | }, 406 | "dist": { 407 | "type": "zip", 408 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", 409 | "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", 410 | "shasum": "" 411 | }, 412 | "require": { 413 | "ext-simplexml": "*", 414 | "ext-tokenizer": "*", 415 | "ext-xmlwriter": "*", 416 | "php": ">=5.4.0" 417 | }, 418 | "require-dev": { 419 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 420 | }, 421 | "bin": [ 422 | "bin/phpcs", 423 | "bin/phpcbf" 424 | ], 425 | "type": "library", 426 | "extra": { 427 | "branch-alias": { 428 | "dev-master": "3.x-dev" 429 | } 430 | }, 431 | "notification-url": "https://packagist.org/downloads/", 432 | "license": [ 433 | "BSD-3-Clause" 434 | ], 435 | "authors": [ 436 | { 437 | "name": "Greg Sherwood", 438 | "role": "lead" 439 | } 440 | ], 441 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 442 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 443 | "keywords": [ 444 | "phpcs", 445 | "standards", 446 | "static analysis" 447 | ], 448 | "support": { 449 | "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", 450 | "source": "https://github.com/squizlabs/PHP_CodeSniffer", 451 | "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" 452 | }, 453 | "time": "2023-02-22T23:07:41+00:00" 454 | }, 455 | { 456 | "name": "wp-coding-standards/wpcs", 457 | "version": "3.0.1", 458 | "source": { 459 | "type": "git", 460 | "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 461 | "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" 462 | }, 463 | "dist": { 464 | "type": "zip", 465 | "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", 466 | "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", 467 | "shasum": "" 468 | }, 469 | "require": { 470 | "ext-filter": "*", 471 | "ext-libxml": "*", 472 | "ext-tokenizer": "*", 473 | "ext-xmlreader": "*", 474 | "php": ">=5.4", 475 | "phpcsstandards/phpcsextra": "^1.1.0", 476 | "phpcsstandards/phpcsutils": "^1.0.8", 477 | "squizlabs/php_codesniffer": "^3.7.2" 478 | }, 479 | "require-dev": { 480 | "php-parallel-lint/php-console-highlighter": "^1.0.0", 481 | "php-parallel-lint/php-parallel-lint": "^1.3.2", 482 | "phpcompatibility/php-compatibility": "^9.0", 483 | "phpcsstandards/phpcsdevtools": "^1.2.0", 484 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 485 | }, 486 | "suggest": { 487 | "ext-iconv": "For improved results", 488 | "ext-mbstring": "For improved results" 489 | }, 490 | "type": "phpcodesniffer-standard", 491 | "notification-url": "https://packagist.org/downloads/", 492 | "license": [ 493 | "MIT" 494 | ], 495 | "authors": [ 496 | { 497 | "name": "Contributors", 498 | "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 499 | } 500 | ], 501 | "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 502 | "keywords": [ 503 | "phpcs", 504 | "standards", 505 | "static analysis", 506 | "wordpress" 507 | ], 508 | "support": { 509 | "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", 510 | "source": "https://github.com/WordPress/WordPress-Coding-Standards", 511 | "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" 512 | }, 513 | "funding": [ 514 | { 515 | "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", 516 | "type": "custom" 517 | } 518 | ], 519 | "time": "2023-09-14T07:06:09+00:00" 520 | } 521 | ], 522 | "aliases": [], 523 | "minimum-stability": "stable", 524 | "stability-flags": [], 525 | "prefer-stable": true, 526 | "prefer-lowest": false, 527 | "platform": [], 528 | "platform-dev": [], 529 | "plugin-api-version": "2.6.0" 530 | } 531 | -------------------------------------------------------------------------------- /playground-embedder.php: -------------------------------------------------------------------------------- 1 | 800, 52 | 'height' => 600, 53 | 'lazy' => 1, 54 | ], 55 | $attributes 56 | ); 57 | 58 | if ( isset( $attributes['start_button'] ) ) { 59 | $attributes['lazy'] = $attributes['start_button']; 60 | unset( $attributes['start_button'] ); 61 | } 62 | 63 | $width = (int) $attributes['width']; 64 | $height = (int) $attributes['height']; 65 | $random_id = wp_rand( 0, 5000 ); 66 | $url = 'https://playground.wordpress.net/remote.html'; 67 | $wh_string = ''; 68 | if ( $width !== 0 && $height !== 0 ) { 69 | $wh_string = 'style="width: ' . $width . 'px; height: ' . $height . 'px"'; 70 | } 71 | 72 | // Remove line breaks. 73 | $blueprint = preg_replace( '//i', "\n", $blueprint ); 74 | 75 | // Replace nice typography quotes with double quotes. 76 | $blueprint = trim( str_replace( [ '“', '”' ], '"', $blueprint ) ); 77 | // Remove unneeded newlines etc. 78 | $blueprint = preg_replace( '/\s+/', ' ', $blueprint ); 79 | 80 | // Parse as JSON. 81 | $blueprint = json_decode( $blueprint ); 82 | // Decoding failed, turn blueprint into an empty object. 83 | if ( $blueprint === null ) { 84 | $blueprint = (object) []; 85 | } 86 | // Re-encode to make sure it's valid JSON and escaped properly. 87 | $blueprint = wp_json_encode( $blueprint, JSON_PRETTY_PRINT ); 88 | 89 | if ( $attributes['lazy'] ) { 90 | return sprintf( 91 | ' 92 | 93 | ', 114 | $random_id, 115 | $wh_string, 116 | $url, 117 | $blueprint 118 | ); 119 | } else { 120 | return sprintf( 121 | ' 122 | ', 133 | $random_id, 134 | $wh_string, 135 | $url, 136 | $blueprint 137 | ); 138 | } 139 | } 140 | } 141 | 142 | new PlaygroundEmbedder(); 143 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Playground Embedder === 2 | Contributors: joostdevalk 3 | Tested up to: 6.2 4 | Stable tag: 1.1 5 | Requires at least: 6.0 6 | Requires PHP: 7.4 7 | License: GPL v3 8 | License URI: https://www.gnu.org/licenses/gpl-3.0.en.html 9 | 10 | Embeds the WordPress playground through a shortcode. 11 | 12 | == Description == 13 | Add the WordPress playground by adding a `[wp_playground]` shortcode to your pages. This plugin supports all the attributes the playground supports, which [you can find here](https://wordpress.github.io/wordpress-playground/docs/query-api#available-options). 14 | 15 | By default, the plugin lazy loads the playground, so it's only loaded after a button click. An additional feature is that you 16 | can decide not to lazy load the playground by adding `lazy=0` to the shortcode, like so: 17 | 18 | [wp_playground lazy=0] 19 | 20 | At this point the plugin renders the playground immediately. 21 | 22 | == Screenshots == 23 | 24 | 1. A default button loaded when the playground is inserted into a page. 25 | 2. The playground in action, this time loaded with `lazy=0`. 26 | 27 | == Changelog == 28 | 29 | = 1.1 = 30 | 31 | Added the lazy loading option. 32 | 33 | = 1.0 = 34 | 35 | Initial release. 36 | 37 | == Installation == 38 | 1. Install & activate the plugin. 39 | 2. Add a `[wp_playground]` shortcode to one of your pages. 40 | 3. You're done. 41 | --------------------------------------------------------------------------------