Making WordPress.org

Changeset 15509


Ignore:
Timestamp:
11/06/2026 09:23:14 PM (4 days ago)
Author:
obenland
Message:

Environments: Add a WordPress.tv environment for the wptv-27 theme

Closes ​https://github.com/WordPress/wordpress.org/pull/1202.

Location:
sites/trunk
Files:
14 added
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/.github/unit-tests-suites.yml

    r15471 r15509  
    157157      - 'environments/support-forums/**'
    158158
     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
    159167  sso:
    160168    type: wordpress
  • sites/trunk/environments/README.md

    r15447 r15509  
    268268**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.
    269269
     270### WordPress.tv
     271
     272A 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
     277npm run wptv:env start
     278```
     279
     280The 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
     287npm run wptv:refresh
     288```
     289
     290**WP CLI:**
     291
     292```bash
     293npm 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
     299npm 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
    270309### Photo Directory
    271310
  • sites/trunk/environments/package.json

    r15447 r15509  
    4646                "support:test:env": "wp-env --config support-forums/.wp-env.test.json",
    4747                "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",
    4852                "freescout:env": "docker compose --file freescout/docker-compose.yml",
    4953                "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  
    221221                                row(__('Submitted by', 'wptv'), el('div', { className: 'wptv-review__links' },
    222222                                        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),
    224224                                        el(components.ExternalLink, { href: `http://en.utrace.de/?query=${encodeURIComponent(submission.ip)}` }, submission.ip)
    225225                                )),
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/inc/content.php

    r15507 r15509  
    5050 * Appends the presentation slides link to the excerpt.
    5151 *
    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.
    5354 * @return string
    5455 */
    55 function excerpt_slides( $excerpt ) {
    56         $slides = get_post_meta( get_the_ID(), '_wptv_slides_url', true );
     56function excerpt_slides( $excerpt, $post = null ) {
     57        $post   = get_post( $post );
     58        $slides = $post ? get_post_meta( $post->ID, '_wptv_slides_url', true ) : '';
    5759
    5860        if ( ! empty( $slides ) ) {
    … …  
    6264        return $excerpt;
    6365}
    64 add_filter( 'get_the_excerpt', __NAMESPACE__ . '\excerpt_slides' );
     66add_filter( 'get_the_excerpt', __NAMESPACE__ . '\excerpt_slides', 10, 2 );
    6567
    6668/*
Note: See TracChangeset for help on using the changeset viewer.