Changeset 15509
- Timestamp:
- 11/06/2026 09:23:14 PM (4 days ago)
- Location:
- sites/trunk
- Files:
-
- 14 added
- 5 edited
-
.github/unit-tests-suites.yml (modified) (1 diff)
-
environments/README.md (modified) (1 diff)
-
environments/mocks/wptv-local.php (added)
-
environments/package.json (modified) (1 diff)
-
environments/wordpress-tv (added)
-
environments/wordpress-tv/.wp-env.json (added)
-
environments/wordpress-tv/.wp-env.test.json (added)
-
environments/wordpress-tv/bin (added)
-
environments/wordpress-tv/bin/after-start-test.sh (added)
-
environments/wordpress-tv/bin/after-start.sh (added)
-
environments/wordpress-tv/bin/import-videos.php (added)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/assets/js/editor.js (modified) (1 diff)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/inc/content.php (modified) (2 diffs)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/phpunit.xml.dist (added)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/tests (added)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/tests/Lockdown_Test.php (added)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/tests/Routes_Test.php (added)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/tests/Submissions_Test.php (added)
-
wordpress.tv/public_html/wp-content/themes/wptv-27/tests/bootstrap.php (added)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/.github/unit-tests-suites.yml
r15471 r15509 157 157 - 'environments/support-forums/**' 158 158 159 wordpress-tv: 160 type: wordpress 161 name: WordPress.tv Theme 162 script: wptv:test 163 paths: 164 - 'environments/wordpress-tv/**' 165 - 'wordpress.tv/public_html/wp-content/themes/wptv-27/**' 166 159 167 sso: 160 168 type: wordpress -
sites/trunk/environments/README.md
r15447 r15509 268 268 **Block editor:** the forums use the block editor through [Blocks Everywhere](https://github.com/Automattic/blocks-everywhere), which is not installed here — it needs a Gutenberg old enough to break against WordPress trunk until [Automattic/blocks-everywhere#211](https://github.com/Automattic/blocks-everywhere/pull/211) lands. `Plugin::__construct()` loads the block support only when that plugin is present, so the environment runs on bbPress' plain editor until then. 269 269 270 ### WordPress.tv 271 272 A local instance of [WordPress.tv](https://wordpress.tv/) with the `wptv-27` block theme and Jetpack, which provides the VideoPress player and the sharing buttons. 273 274 **Start:** 275 276 ```bash 277 npm run wptv:env start 278 ``` 279 280 The first start imports about 60 recent, featured, Education and How-To videos from WordPress.tv. It brings their speakers, events, languages, categories and producers, plus the site's pages. Each video embeds its real VideoPress video, so the players stream and the thumbnails load. A pending submission is added for the moderation tools. 281 282 **Access:** `http://localhost:8888`. Log in with `admin` / `password` to edit videos or moderate submissions. 283 284 **Import new videos** (clears the import flag, then imports the videos that are missing): 285 286 ```bash 287 npm run wptv:refresh 288 ``` 289 290 **WP CLI:** 291 292 ```bash 293 npm run wptv:env -- run cli -- wp <command> 294 ``` 295 296 **Run tests** (the theme's PHPUnit suite, in a dedicated test environment): 297 298 ```bash 299 npm run wptv:test 300 ``` 301 302 **What differs from production.** WordPress.tv runs on WordPress.com, which provides VideoPress internals that Jetpack doesn't have. Without them, the theme leaves out what it builds from them: 303 304 - Download links, subtitle tracks, and the video data in JSON-LD and Open Graph tags are missing, and `/api/videos.json` lists no video files. 305 - `/oembed/` and `/unisubs/` answer with an error for every video. 306 - Jetpack runs in offline mode. `mocks/wptv-local.php` turns on the VideoPress and Sharing modules anyway, so the players and sharing buttons render. The Like button needs a connection, so it doesn't show, and the editor asks to connect Jetpack. 307 - Uploads from the submission form stay local instead of going to VideoPress, so every submission gets the State of the Word 2024 video. 308 270 309 ### Photo Directory 271 310 -
sites/trunk/environments/package.json
r15447 r15509 46 46 "support:test:env": "wp-env --config support-forums/.wp-env.test.json", 47 47 "support:test": "npm run support:test:env -- start && npm run support:test:env -- run cli --env-cwd=wp-content/plugins/support-forums phpunit", 48 "wptv:env": "wp-env --config wordpress-tv/.wp-env.json", 49 "wptv:refresh": "npm run wptv:env -- run cli -- wp option delete wptv_env_imported; npm run wptv:env -- run cli -- wp eval-file wp-content/env-bin/import-videos.php", 50 "wptv:test:env": "wp-env --config wordpress-tv/.wp-env.test.json", 51 "wptv:test": "npm run wptv:test:env -- start && npm run wptv:test:env -- run cli --env-cwd=wp-content/themes/wptv-27 phpunit", 48 52 "freescout:env": "docker compose --file freescout/docker-compose.yml", 49 53 "freescout:start": "npm run freescout:env -- up --detach --build --wait && npm run freescout:setup", -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/assets/js/editor.js
r15507 r15509 221 221 row(__('Submitted by', 'wptv'), el('div', { className: 'wptv-review__links' }, 222 222 el('span', null, submission.submitted_by), 223 el('a', { href: `mailto:${ submission.submitted_email}?Subject=Your%20WordPress.tv%20submission` }, submission.submitted_email),223 el('a', { href: `mailto:${encodeURIComponent(submission.submitted_email)}?Subject=Your%20WordPress.tv%20submission` }, submission.submitted_email), 224 224 el(components.ExternalLink, { href: `http://en.utrace.de/?query=${encodeURIComponent(submission.ip)}` }, submission.ip) 225 225 )), -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/inc/content.php
r15507 r15509 50 50 * Appends the presentation slides link to the excerpt. 51 51 * 52 * @param string $excerpt Post excerpt. 52 * @param string $excerpt Post excerpt. 53 * @param \WP_Post|null $post Post the excerpt belongs to. Defaults to the current post. 53 54 * @return string 54 55 */ 55 function excerpt_slides( $excerpt ) { 56 $slides = get_post_meta( get_the_ID(), '_wptv_slides_url', true ); 56 function excerpt_slides( $excerpt, $post = null ) { 57 $post = get_post( $post ); 58 $slides = $post ? get_post_meta( $post->ID, '_wptv_slides_url', true ) : ''; 57 59 58 60 if ( ! empty( $slides ) ) { … … 62 64 return $excerpt; 63 65 } 64 add_filter( 'get_the_excerpt', __NAMESPACE__ . '\excerpt_slides' );66 add_filter( 'get_the_excerpt', __NAMESPACE__ . '\excerpt_slides', 10, 2 ); 65 67 66 68 /*
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)