Skip to content

Commit 4889250

Browse files
authored
Merge pull request #428 from alleyinteractive/update-fam-latest
Update fam branch with latest from develop
2 parents b31a891 + 5e85ab8 commit 4889250

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+25134
-44428
lines changed

.deployignore

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
.DS_Store
2-
Thumbs.db
3-
wp-cli.local.yml
4-
node_modules/
2+
.github
3+
.phpcs
4+
.phpcs.xml
5+
.phpunit.result.cache
6+
.scaffolder
7+
.scoper
8+
.wp-env.json
59
*.sql
610
*.tar.gz
711
*.zip
8-
.phpunit.result.cache
9-
Dockerfile
10-
output.log
11-
.github
12-
tests
12+
babel.config.js
1313
bin
1414
composer.lock
15-
.phpcs.xml
16-
phpunit.xml
1715
configure.php
1816
DOCKER_ENV
17+
Dockerfile
18+
jest.config.js
19+
Makefile
20+
node_modules/
21+
output.log
22+
phpstan.neon
1923
phpunit.xml
24+
.phpunit-watcher.yml
25+
rector.php
2026
tests
21-
.phpcs
22-
Makefile
27+
tests
28+
Thumbs.db
29+
tsconfig.eslint.json
30+
tsconfig.json
31+
wp-cli.local.yml

.github/workflows/all-pr-tests.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
name: "All Pull Request Tests"
22

33
on:
4+
push:
5+
branches:
6+
- develop
47
pull_request:
58
branches:
69
- develop
710
types: [opened, synchronize, reopened, ready_for_review]
811

912
jobs:
13+
find-wordpress-versions:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
versions: ${{ steps.get-versions.outputs.versions }}
17+
steps:
18+
- name: Get WordPress Versions
19+
id: get-versions
20+
run: echo "versions=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r '.offers[] | select(.response == "autoupdate").version' | head -n 3 | sort -u | sed 's/\.[^.]*$//' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
21+
1022
# We use a single job to ensure that all steps
1123
# run in the same environment and reduce the number of minutes used.
1224
pr-tests:
1325
# Don't run on draft PRs
1426
if: github.event.pull_request.draft == false
27+
needs: find-wordpress-versions
1528
runs-on: ubuntu-latest
1629
# Timeout after 10 minutes
1730
timeout-minutes: 10
1831
# Define a matrix of PHP/WordPress versions to test against
1932
strategy:
33+
fail-fast: false
2034
matrix:
2135
php: [8.2, 8.3, 8.4]
22-
wordpress: ["latest"]
36+
wordpress: ${{fromJson(needs.find-wordpress-versions.outputs.versions)}}
2337
# Cancel any existing runs of this workflow
2438
concurrency:
2539
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
release-notes: ${{ github.event.release.body }}
2222

2323
- name: Commit updated CHANGELOG
24-
uses: stefanzweifel/git-auto-commit-action@v6
24+
uses: stefanzweifel/git-auto-commit-action@v7
2525
with:
2626
branch: main
2727
commit_message: Update CHANGELOG

.phpcs.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,8 @@
6161
<rule ref="WordPress.Files">
6262
<exclude-pattern>tests/*</exclude-pattern>
6363
</rule>
64+
65+
<rule ref="Squiz.PHP.DisallowMultipleAssignments.Found">
66+
<exclude-pattern>tests/*</exclude-pattern>
67+
</rule>
6468
</ruleset>

.stylelintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
3+
# Client build files
4+
client/build/
5+
/vendor

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
All notable changes to `WP Curate` will be documented in this file.
44

5+
## Unreleased
6+
7+
- Enhancement: Enable pinning scheduled posts via `wp_curate_include_future_posts` filter.
8+
9+
## 3.0.0 - 2025-10-31
10+
11+
- Support for previews of Query block and Patterns.
12+
- Pattern/Variation picker when inserting a Query block.
13+
- Post blocks can now exist outside of Post Template blocks, allowing for more complex layouts
14+
and individual inner blocks on the Post block.
15+
- Upgrade to PHPStan to 2.0.
16+
- Added unit tests for existing plugin functionality.
17+
18+
## 2.7.2 - 2025-10-15
19+
20+
- Enhancement: Post Picker results filtered to match Query block parameters by default.
21+
- Enhancement: Text alignment support in Post Title block.
22+
- Bug fix: Fix issue where reducing number of posts caused some posts to be hidden in the editor.
23+
- Bug fix: Fix PHP warnings.
24+
525
## 2.7.1 - 2025-10-01
626

727
- Enhancement: Add option to "Pin This Post" so editors can pin the selected post.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# WP Curate
22

3-
[![All Pull Request Tests](https://github.com/alleyinteractive/wp-curate/actions/workflows/all-pr-tests.yml/badge.svg)](https://github.com/alleyinteractive/wp-curate/actions/workflows/all-pr-tests.yml)
3+
[![All Pull Request Tests](https://github.com/alleyinteractive/wp-curate/actions/workflows/all-pr-tests.yml/badge.svg?branch=develop)](https://github.com/alleyinteractive/wp-curate/actions/workflows/all-pr-tests.yml)
44

55
A plugin for WordPress to build flexible, curatable layouts for homepages and landing pages.
66

blocks/post-title/block.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
},
2424
"render": "file:render.php",
2525
"supports": {
26-
"inserter": false
26+
"inserter": true,
27+
"typography": {
28+
"textAlign": true
29+
}
2730
}
2831
}

blocks/post-title/edit.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface PostTitleEditProps {
2020
include?: string;
2121
orderby?: string;
2222
};
23-
pinnedPosts?: Array<number>;
23+
pinnedPosts?: Array<number | null>;
2424
customPostTitles?: {
2525
postId: number;
2626
title: string;
@@ -46,13 +46,13 @@ export default function Edit({
4646
const queryParentId = queryParentIds.length ? queryParentIds[queryParentIds.length - 1] : null;
4747

4848
const {
49-
postId,
49+
postId = null,
5050
pinnedPosts = [],
51-
query: { postType = 'post' },
51+
query: { postType = 'post' } = {},
5252
customPostTitles = [],
5353
} = context;
5454
const { level = 3, supportsLevel } = attributes;
55-
const [rawTitle = '', , fullTitle] = useEntityProp('postType', postType, 'title', postId.toString());
55+
const [rawTitle = '', , fullTitle] = useEntityProp('postType', postType, 'title', postId?.toString());
5656
const isPinned = pinnedPosts.includes(postId);
5757
const currentCustomPostTitle = customPostTitles.find((item) => item?.postId === postId);
5858
const TagName = !supportsLevel || level === 0 ? 'p' : `h${level}`;
@@ -74,6 +74,10 @@ export default function Edit({
7474
}, [isPinned, postId, customPostTitles, currentCustomPostTitle, setAttributes, queryParentId]);
7575

7676
const handleOnChange = (title: string) => {
77+
if (!postId) {
78+
return;
79+
}
80+
7781
/**
7882
* Handle case for removing custom title from the collection if a
7983
* custom title no longer exists.

blocks/post-title/render.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
* @package wp-curate
1414
*/
1515

16-
$current_post_id = intval( $block->context['postId'] );
16+
use function Mantle\Support\Helpers\mixed;
17+
18+
$current_post_id = mixed( $block->context['postId'] )->int();
1719

1820
if ( empty( $current_post_id ) ) {
1921
return;
2022
}
2123

22-
$custom_post_titles = ! empty( $block->context['customPostTitles'] ) ? $block->context['customPostTitles'] : [];
24+
$custom_post_titles = ! empty( $block->context['customPostTitles'] ) && is_array( $block->context['customPostTitles'] ) ? $block->context['customPostTitles'] : [];
2325
$post_title = get_the_title( $current_post_id );
2426
$post_link = get_the_permalink( $current_post_id );
2527
$level = is_int( $attributes['level'] ) ? intval( $attributes['level'] ) : 0;
@@ -32,7 +34,7 @@
3234
// Use custom post title, if available.
3335
if ( 0 < count( $custom_post_titles ) ) {
3436
foreach ( $custom_post_titles as $value ) {
35-
if ( $value['postId'] === $current_post_id ) {
37+
if ( is_array( $value ) && isset( $value['postId'] ) && $value['postId'] === $current_post_id && is_string( $value['title'] ) ) {
3638
$post_title = $value['title'];
3739
break;
3840
}

0 commit comments

Comments
 (0)