Changeset 15510
- Timestamp:
- 11/06/2026 10:25:21 PM (4 days ago)
- Location:
- sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27
- Files:
-
- 1 added
- 2 deleted
- 5 edited
-
assets (deleted)
-
functions.php (modified) (1 diff)
-
inc/global-footer.php (added)
-
inc/setup.php (modified) (2 diffs)
-
inc/single.php (modified) (1 diff)
-
parts/footer.html (modified) (1 diff)
-
patterns (deleted)
-
style.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/functions.php
r15507 r15510 33 33 require_once WPTV_THEME_DIR . '/inc/publishing.php'; 34 34 require_once WPTV_THEME_DIR . '/inc/open-graph.php'; 35 require_once WPTV_THEME_DIR . '/inc/global-footer.php'; 35 36 require_once WPTV_THEME_DIR . '/inc/redirects.php'; 36 37 require_once WPTV_THEME_DIR . '/inc/maintenance.php'; -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/inc/setup.php
r15507 r15510 20 20 add_editor_style( 'style.css' ); 21 21 22 // Same location name s as wptv2, so the assigned menus surviveswitching between both themes.22 // Same location name as wptv2, so the assigned menu survives switching between both themes. 23 23 register_nav_menus( 24 24 array( 25 25 'primary' => __( 'Primary Menu', 'wptv' ), 26 'footer' => __( 'Footer Menu', 'wptv' ),27 26 ) 28 27 ); … … 84 83 } 85 84 add_filter( 'render_block_data', __NAMESPACE__ . '\primary_menu_links' ); 86 87 /**88 * Fills the footer "Contribute" list with the classic menu assigned to `footer`.89 *90 * Only top-level items are shown, as wptv2's footer menu (depth 1). Links to91 * other sites get the decorative arrow the footer design uses. Without an92 * assigned menu, or with an empty one, the pattern's own links are kept.93 *94 * @param string $content Rendered List block.95 * @param array $block Parsed block.96 * @return string97 */98 function footer_menu_links( $content, $block ) {99 $classes = preg_split( '/\s+/', $block['attrs']['className'] ?? '' );100 if ( ! in_array( 'wptv-footer__contribute', $classes, true ) || ! preg_match( '/^\s*(<ul\b[^>]*>)/', $content, $opening ) ) {101 return $content;102 }103 104 $locations = get_nav_menu_locations();105 $menu = wp_get_nav_menu_object( $locations['footer'] ?? 0 );106 $items = $menu ? wp_get_nav_menu_items( $menu->term_id ) : array();107 if ( ! $items ) {108 return $content;109 }110 111 $home_host = wp_parse_url( home_url(), PHP_URL_HOST );112 $links = '';113 foreach ( $items as $item ) {114 if ( (int) $item->menu_item_parent ) {115 continue;116 }117 $host = wp_parse_url( $item->url, PHP_URL_HOST );118 $arrow = ( $host && $host !== $home_host ) ? ' <span aria-hidden="true">↗</span>' : '';119 $target = $item->target ? ' target="' . esc_attr( $item->target ) . '" rel="noopener"' : '';120 $links .= '<li><a href="' . esc_url( $item->url ) . '"' . $target . '>' . esc_html( $item->title ) . $arrow . '</a></li>';121 }122 123 return $links ? $opening[1] . $links . '</ul>' : $content;124 }125 add_filter( 'render_block_core/list', __NAMESPACE__ . '\footer_menu_links', 10, 2 );126 85 127 86 /** -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/inc/single.php
r15507 r15510 41 41 } 42 42 add_filter( 'render_block_core/post-excerpt', __NAMESPACE__ . '\\full_description', 10, 3 ); 43 44 // The pattern's Sharing Buttons block replaces Jetpack's classic buttons, which would add two more rows. 45 add_filter( 'sharing_show', '__return_false' ); -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/parts/footer.html
r15507 r15510 1 <!-- wp: pattern {"slug":"wptv/footer"}/-->1 <!-- wp:wptv/global-footer /--> -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv-27/style.css
r15507 r15510 27 27 .wp-site-blocks main { padding-block: var(--wp--preset--spacing--60); } 28 28 .wp-site-blocks main.is-flush { padding-block: 0; } 29 .wp-site-blocks main.wptv-single { padding-block-end: var(--wp--preset--spacing--60); } 29 30 :where(.wp-block-group, .wp-block-column, .wp-block-post, .wp-block-query) { min-width: 0; } 30 31 :where(input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), textarea, select) { … … 71 72 .wptv-header .is-menu-open .wp-block-navigation-item { padding-block: 12px; border-bottom: 1px solid var(--wp--preset--color--light-grey-1); } 72 73 .wptv-header .is-menu-open .wp-block-search { width: 100%; } 73 .wptv-footer { padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30); font-size: var(--wp--preset--font-size--small); } 74 .wptv-footer a { color: var(--wp--preset--color--white); text-decoration: none; } 75 .wptv-footer a:hover { text-decoration: underline; } 76 .wptv-footer a:focus { outline-color: var(--wp--preset--color--blueberry-2); } 77 .wptv-footer__heading { font: 600 var(--wp--preset--font-size--small)/1.625 var(--wp--preset--font-family--inter); color: var(--wp--preset--color--white); } 78 .wptv-footer__columns { gap: 30px; } 79 .wptv-footer__columns > .wp-block-column:first-child { flex-grow: 2; } 80 .wptv-footer__links { list-style: none; padding: 0; } 81 .wptv-footer__links li + li { margin-top: 8px; } 82 .wptv-footer__license { border-top: 1px solid var(--wp--preset--color--white-opacity-15); margin-top: var(--wp--preset--spacing--40); padding-top: var(--wp--preset--spacing--20); gap: 20px; } 83 .wptv-footer .wp-block-site-title { font-family: var(--wp--preset--font-family--inter); font-size: var(--wp--preset--font-size--large); } 84 .wptv-footer__wporg { margin: 0; } 85 .wptv-footer .wp-block-site-title + p, 86 .wptv-footer .wptv-footer__wporg + p { margin-block-start: 0; } 87 .wptv-footer__wporg img { display: block; width: auto; max-width: 100%; height: 27px; } 74 .global-footer a:focus { outline-color: var(--wp--preset--color--blueberry-2); } 75 .global-footer a[href="https://wordpress.tv/"] [aria-hidden="true"] { display: none; } 88 76 /* === cards === */ 89 77 .is-style-cards-grid { gap: var(--wp--preset--spacing--20); } … … 231 219 } 232 220 @media (max-width: 781px) { 233 .wptv-footer .wptv-footer__columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }234 .wptv-footer__columns > .wp-block-column:first-child { grid-column: 1 / -1; }235 221 .wptv-home__section-heading { align-items: start; } 236 222 }
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)