Skip to content

Commit d5355f6

Browse files
authored
Merge pull request #387 from alleyinteractive/feature/issue-378/pin-this-post-shortcut-backfill
Issue-378: Add option to \"Pin this Post\" in addition to \"Pin a Post\"
2 parents 55218ed + a3392e8 commit d5355f6

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

CHANGELOG.md

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

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

5+
## 2.7.1 - 2025-10-01
6+
7+
- Enhancement: Add option to "Pin This Post" so editors can pin the selected post.
8+
59
## 2.7.0 - 2025-09-05
610

711
- Enhancement: Update wp-type-extensions to 4.0.0.

blocks/post/edit.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,26 @@ export default function Edit({
203203
value={selected ?? 0}
204204
previewRender={(NoRender)}
205205
className="wp-curate-post-block__post-picker"
206-
selectText={__('Pin a post', 'wp-curate')}
207-
resetText={__('Backfill post', 'wp-curate')}
208-
replaceText={__('Pin a different post', 'wp-curate')}
206+
selectText={__('Pin a Post', 'wp-curate')}
207+
resetText={__('Backfill Post', 'wp-curate')}
208+
replaceText={__('Pin a Different Post', 'wp-curate')}
209209
/>
210+
{
211+
// If this post isn't already in the posts list, show a button to pin it.
212+
!posts.includes(postId) && !postDeleted
213+
? (
214+
<Button
215+
className="wp-curate-post-block__pin-post"
216+
variant="secondary"
217+
onClick={() => {
218+
updatePost(postId);
219+
}}
220+
>
221+
{__('Pin This Post', 'wp-curate')}
222+
</Button>
223+
)
224+
: null
225+
}
210226
</div>
211227
) : null}
212228
</div>

blocks/post/index.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@
1313
}
1414

1515
&__actions {
16-
align-items: center;
16+
align-items: flex-end;
1717
display: flex;
18-
justify-content: space-between;
18+
gap: 0.5rem;
19+
justify-content: flex-end;
1920
margin-top: 0.5rem;
20-
21-
&__post-picker {
22-
align-self: flex-end;
23-
}
2421
}
2522
}
2623

@@ -67,10 +64,10 @@
6764
.wp-curate-post-block__actions, .components-button-group {
6865
display: flex;
6966
flex-direction: column;
67+
gap: 0.5rem;
7068
width: 100%;
7169

7270
button {
73-
margin: 0 0 0.25rem 0 !important;
7471
text-align: left;
7572
width: 100%;
7673
}

wp-curate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WP Curate
44
* Plugin URI: https://github.com/alleyinteractive/wp-curate
55
* Description: Plugin to curate homepages and other landing pages
6-
* Version: 2.7.0
6+
* Version: 2.7.1
77
* Author: Alley Interactive
88
* Author URI: https://github.com/alleyinteractive/wp-curate
99
* Requires at least: 6.4

0 commit comments

Comments
 (0)