Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languages/ja.l10n.php

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions languages/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,10 @@ msgstr "SNSシェアボタンを表示する"
msgid "Display Date on the page"
msgstr "日付を表示する"

#: build/edit-post/index.js:1
msgid "Eye-catching YouTube video"
msgstr "アイキャッチ用 YouTube動画"

#: build/format-library/font-size/index.js:62
#: build/format-library/index.js:1
#: build/format-library/font-size/index.js:49
Expand Down Expand Up @@ -1555,6 +1559,14 @@ msgstr "GitHubアカウント設定からGitHubトークンを取得できます
msgid "https://mone-wp.com/get-github-token/"
msgstr "https://mone-wp.com/get-github-token/"

#: build/plugins/index.js:1
msgid "Eye-catching hover effects"
msgstr "アイキャッチ ホバーエフェクト"

#: build/plugins/index.js:1
msgid "Apply a hover effect to the featured image in the query block."
msgstr "クエリーブロック内のアイキャッチ画像に、ホバーエフェクトを適用します。"

#: build/plugins/index.js:689
#: build/plugins/index.js:543
#: build/plugins/index.js:1 build/plugins/index.js:310
Expand Down
2 changes: 1 addition & 1 deletion languages/mone-ja-195c2ee33af3438dc681885037a9dd77.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2024-11-30 18:18+0900","generator":"WP-CLI\/2.11.0","source":"build\/edit-post\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ja","plural-forms":"nplurals=2; plural=(n != 1);"},"Mone post settings":["Mone\u6295\u7a3f\u8a2d\u5b9a"],"Display eye-catcher on the page":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u3092\u8868\u793a\u3059\u308b"],"Display SNS Share Button on the page":["SNS\u30b7\u30a7\u30a2\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3059\u308b"],"Display Date on the page":["\u65e5\u4ed8\u3092\u8868\u793a\u3059\u308b"]}}}
{"translation-revision-date":"2024-11-30 18:18+0900","generator":"WP-CLI\/2.11.0","source":"build\/edit-post\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ja","plural-forms":"nplurals=2; plural=(n != 1);"},"Mone post settings":["Mone\u6295\u7a3f\u8a2d\u5b9a"],"Display eye-catcher on the page":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u3092\u8868\u793a\u3059\u308b"],"Display SNS Share Button on the page":["SNS\u30b7\u30a7\u30a2\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3059\u308b"],"Display Date on the page":["\u65e5\u4ed8\u3092\u8868\u793a\u3059\u308b"],"Eye-catching YouTube video":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u7528 YouTube\u52d5\u753b"]}}}
2 changes: 1 addition & 1 deletion languages/mone-ja-3e269739140661535e51ccca9f6b443d.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"translation-revision-date":"2024-11-30 18:18+0900","generator":"WP-CLI\/2.11.0","source":"build\/plugins\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ja","plural-forms":"nplurals=2; plural=(n != 1);"},"More Information":["\u8a73\u7d30\u60c5\u5831"],"Learn More":["\u3055\u3089\u306b\u8a73\u3057\u304f"],"Add NO IMAGE":["NO IMAGE\u3092\u8ffd\u52a0"],"Default NO IMAGE":["\u30c7\u30d5\u30a9\u30eb\u30c8 NO IMAGE"],"NO IMAGE":["NO IMAGE \u753b\u50cf"],"GitHub Token":["GitHub\u30c8\u30fc\u30af\u30f3"],"You can get a GitHub token from your GitHub account settings. This token is used to increase the number of requests to the GitHub API.":["GitHub\u30a2\u30ab\u30a6\u30f3\u30c8\u8a2d\u5b9a\u304b\u3089GitHub\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c8\u30fc\u30af\u30f3\u306f\u3001GitHubAPI\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u3092\u5897\u3084\u3059\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002"],"https:\/\/mone-wp.com\/get-github-token\/":["https:\/\/mone-wp.com\/get-github-token\/"],"Site settings":["\u30b5\u30a4\u30c8\u8a2d\u5b9a"],"Show NO IMAGE in query":["\u30af\u30a8\u30ea\u30fc\u3067NO IMAGE\u3092\u8868\u793a"],"Show NO IMAGE on the page":["\u30da\u30fc\u30b8\u3067NO IMAGE\u3092\u8868\u793a"],"Display eye-catching template":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8868\u793a"],"User Settings":["\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a"],"Eye-catching template":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8"],"Mone settings":["Mone \u8a2d\u5b9a"],"This setting is immediately saved to the database.":["\u3053\u306e\u8a2d\u5b9a\u306f\u3059\u3050\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002"]}}}
{"translation-revision-date":"2024-11-30 18:18+0900","generator":"WP-CLI\/2.11.0","source":"build\/plugins\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"ja","plural-forms":"nplurals=2; plural=(n != 1);"},"More Information":["\u8a73\u7d30\u60c5\u5831"],"Learn More":["\u3055\u3089\u306b\u8a73\u3057\u304f"],"Add NO IMAGE":["NO IMAGE\u3092\u8ffd\u52a0"],"Default NO IMAGE":["\u30c7\u30d5\u30a9\u30eb\u30c8 NO IMAGE"],"NO IMAGE":["NO IMAGE \u753b\u50cf"],"GitHub Token":["GitHub\u30c8\u30fc\u30af\u30f3"],"You can get a GitHub token from your GitHub account settings. This token is used to increase the number of requests to the GitHub API.":["GitHub\u30a2\u30ab\u30a6\u30f3\u30c8\u8a2d\u5b9a\u304b\u3089GitHub\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c8\u30fc\u30af\u30f3\u306f\u3001GitHubAPI\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u3092\u5897\u3084\u3059\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002"],"https:\/\/mone-wp.com\/get-github-token\/":["https:\/\/mone-wp.com\/get-github-token\/"],"Eye-catching hover effects":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1 \u30db\u30d0\u30fc\u30a8\u30d5\u30a7\u30af\u30c8"],"Apply a hover effect to the featured image in the query block.":["\u30af\u30a8\u30ea\u30fc\u30d6\u30ed\u30c3\u30af\u5185\u306e\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u306b\u3001\u30db\u30d0\u30fc\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u9069\u7528\u3057\u307e\u3059\u3002"],"Site settings":["\u30b5\u30a4\u30c8\u8a2d\u5b9a"],"Show NO IMAGE in query":["\u30af\u30a8\u30ea\u30fc\u3067NO IMAGE\u3092\u8868\u793a"],"Show NO IMAGE on the page":["\u30da\u30fc\u30b8\u3067NO IMAGE\u3092\u8868\u793a"],"Display eye-catching template":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8868\u793a"],"User Settings":["\u30e6\u30fc\u30b6\u30fc\u8a2d\u5b9a"],"Eye-catching template":["\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8"],"Mone settings":["Mone \u8a2d\u5b9a"],"This setting is immediately saved to the database.":["\u3053\u306e\u8a2d\u5b9a\u306f\u3059\u3050\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002"]}}}
41 changes: 36 additions & 5 deletions languages/mone.pot
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (C) 2025 Tomoki Shimomura
# Copyright (C) 2026 Tomoki Shimomura
# This file is distributed under the GNU General Public License v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: Mone 1.6.0\n"
"Project-Id-Version: Mone 1.8.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/mone\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-03-03T21:47:40+00:00\n"
"POT-Creation-Date: 2026-02-23T07:25:41+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: mone\n"
Expand Down Expand Up @@ -701,11 +701,11 @@ msgid "Hatena"
msgstr ""

#: build/block-hook/button/index.js:1
msgid "Pocket"
msgid "LINE"
msgstr ""

#: build/block-hook/button/index.js:1
msgid "LINE"
msgid "Pocket (deprecated)"
msgstr ""

#: build/block-hook/button/index.js:1
Expand Down Expand Up @@ -1183,6 +1183,10 @@ msgstr ""
msgid "white"
msgstr ""

#: build/block-library/styles-switcher/index.js:1
msgid "Display"
msgstr ""

#: build/block-library/styles-switcher/index.js:1
msgid "isToggle"
msgstr ""
Expand Down Expand Up @@ -1251,6 +1255,10 @@ msgstr ""
msgid "Display Date on the page"
msgstr ""

#: build/edit-post/index.js:1
msgid "Eye-catching YouTube video"
msgstr ""

#: build/format-library/index.js:1
msgid "Block Toolbar"
msgstr ""
Expand Down Expand Up @@ -1391,6 +1399,14 @@ msgstr ""
msgid "https://mone-wp.com/get-github-token/"
msgstr ""

#: build/plugins/index.js:1
msgid "Eye-catching hover effects"
msgstr ""

#: build/plugins/index.js:1
msgid "Apply a hover effect to the featured image in the query block."
msgstr ""

#: build/plugins/index.js:1
msgid "Mone settings"
msgstr ""
Expand Down Expand Up @@ -1743,6 +1759,21 @@ msgctxt "Custom template name"
msgid "404"
msgstr ""

#: theme.json
msgctxt "Border radius size name"
msgid "1"
msgstr ""

#: theme.json
msgctxt "Border radius size name"
msgid "2"
msgstr ""

#: theme.json
msgctxt "Border radius size name"
msgid "3"
msgstr ""

#: theme.json
msgctxt "Gradient name"
msgid "Black"
Expand Down
111 changes: 111 additions & 0 deletions phpunit/tests/post-featured-image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?php
/**
* Post_Featured_Image block rendering tests.
*
* @package WordPress
* @subpackage Blocks
*/

/**
* Tests for the Cover block.
*
* @group blocks
*/
class Tests_Blocks_Render_Post_Featured_Image extends WP_UnitTestCase {
/**
* Post object.
*
* @var object
*/
protected static $post;

/**
* Attachment id.
*
* @var int
*/
protected static $attachment_id;

/**
* Block object.
*
* @var WP_Block
*/
protected static $block;

/**
* Setup method.
*/
public static function wpSetUpBeforeClass() {
self::$post = self::factory()->post->create_and_get();
self::$block = new stdClass();
}

/**
* Tear down method.
*/
public static function wpTearDownAfterClass() {
wp_delete_post( self::$post->ID, true );
wp_delete_post( self::$attachment_id, true );
}

/**
* Test gutenberg_render_block_core_post_featured_image() method.
*
* @covers ::gutenberg_render_block_core_post_featured_image
*/
public function test_gutenberg_render_block_core_post_featured_image() {
$file = DIR_TESTDATA . '/images/canola.jpg';
self::$attachment_id = self::factory()->attachment->create_upload_object(
$file,
self::$post->ID,
array(
'post_mime_type' => 'image/jpeg',
)
);
set_post_thumbnail( self::$post, self::$attachment_id );

$GLOBALS['post'] = self::$post;
$content = '<!-- wp:post-featured-image {"style":{"color":{"duotone":"var:preset|duotone|grayscale"}}} /-->';
self::$block->context = array( 'postId' => self::$post->ID );
$parsed_blocks = parse_blocks( $content );
$block = new WP_Block( $parsed_blocks[0], self::$block->context );
$rendered = $block->render();

print PHP_EOL;
print '------------------------------------' . PHP_EOL;
print 'Tests_Image_Post_Featured_Image' . PHP_EOL;
print '------------------------------------' . PHP_EOL;
$this->assertStringContainsString( wp_get_attachment_image_url( self::$attachment_id, 'full' ), $rendered );
$this->assertStringContainsString( 'wp-duotone-grayscale', $rendered );
}

/**
* Test post featured image with no image and default in query.
*/
public function test_post_featured_image_no_image_default_in_query() {

$GLOBALS['post'] = self::$post;
$content = '<!-- wp:query {"queryId":1,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[],"format":[]}} -->
<div class="wp-block-query"><!-- wp:post-template {"layout":{"type":"grid","columnCount":3}} -->
<!-- wp:post-title /-->

<!-- wp:post-featured-image /-->

<!-- wp:post-date /-->
<!-- /wp:post-template --></div>
<!-- /wp:query -->';
self::$block->context = array( 'postId' => self::$post->ID );
$parsed_blocks = parse_blocks( $content );
$block = new WP_Block( $parsed_blocks[0], self::$block->context );
$rendered = $block->render();

$default_image_url = get_template_directory_uri() . '/assets/images/no-image.png';

print PHP_EOL;
print '------------------------------------' . PHP_EOL;
print 'Tests_No_Image_In_Query_Default_Post_Featured_Image' . PHP_EOL;
print '------------------------------------' . PHP_EOL;
$this->assertStringContainsString( $default_image_url, $rendered );
}
}
1 change: 1 addition & 0 deletions src/block-hook/post-featured-image/block.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"viewScriptModule": "file:./view.js",
"editorScript": "file:./index.js"
}
1 change: 1 addition & 0 deletions src/block-hook/post-featured-image/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import './editor.scss';
import './style.scss';
Loading