Skip to content
Draft
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
16 changes: 16 additions & 0 deletions includes/blocks/class-convertkit-block-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function __construct() {
// Register this as a Gutenberg block in the ConvertKit Plugin.
add_filter( 'convertkit_blocks', array( $this, 'register' ) );

// Register this block's MCP abilities.
add_filter( 'convertkit_abilities', array( $this, 'register_abilities' ) );

// Enqueue scripts for this Gutenberg Block in the editor view.
add_action( 'convertkit_gutenberg_enqueue_scripts', array( $this, 'enqueue_scripts_editor' ) );

Expand Down Expand Up @@ -101,6 +104,19 @@ public function get_title() {

}

/**
* Returns this block's plural title.
*
* @since 3.4.0
*
* @return string
*/
public function get_title_plural() {

return __( 'Kit Forms', 'convertkit' );

}

/**
* Returns this block's icon.
*
Expand Down
8 changes: 4 additions & 4 deletions includes/blocks/class-convertkit-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public function register_abilities( $abilities ) {
return array_merge(
$abilities,
array(
new ConvertKit_MCP_Ability_Content_List( $this ),
new ConvertKit_MCP_Ability_Content_Insert( $this ),
new ConvertKit_MCP_Ability_Content_Update( $this ),
new ConvertKit_MCP_Ability_Content_Delete( $this ),
'kit/' . $this->get_name() . '-list' => new ConvertKit_MCP_Ability_Content_List( $this ),
'kit/' . $this->get_name() . '-insert' => new ConvertKit_MCP_Ability_Content_Insert( $this ),
'kit/' . $this->get_name() . '-update' => new ConvertKit_MCP_Ability_Content_Update( $this ),
'kit/' . $this->get_name() . '-delete' => new ConvertKit_MCP_Ability_Content_Delete( $this ),
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

return sprintf(
/* translators: %s: block title */
__( 'Delete an existing %s element from a post', 'convertkit' ),
__( 'Delete Existing %s from a Post, Page or Custom Post', 'convertkit' ),
$this->block->get_title()
);

Expand All @@ -67,10 +67,9 @@
public function get_description() {

return sprintf(
/* translators: 1: block full name e.g. convertkit/form, 2: block title */
__( 'Removes a single occurrence of the %1$s (%2$s) element from the given post.', 'convertkit' ),
'convertkit/' . $this->block->get_name(),
$this->block->get_title()
/* translators: Block Name */
__( 'Removes an existing %s from a Post, Page or Custom Post using the supplied zero-based occurrence index.', 'convertkit' ),
$this->block->get_title_plural()

Check failure on line 72 in includes/mcp/abilities/content/class-convertkit-mcp-ability-content-delete.php

View workflow job for this annotation

GitHub Actions / Coding Standards / WordPress latest / PHP 7.4

Call to an undefined method ConvertKit_Block::get_title_plural().
);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

return sprintf(
/* translators: %s: block title */
__( 'Insert a %s element into a post', 'convertkit' ),
__( 'Insert %s into a Page, Post or Custom Post', 'convertkit' ),
$this->block->get_title()
);

Expand All @@ -59,9 +59,8 @@

return sprintf(
/* translators: 1: block full name e.g. convertkit/form, 2: block title */
__( 'Inserts a new %1$s (%2$s) element into the given post\'s content. The element can be appended (default), prepended, or positioned relative to an existing element using a zero-based index.', 'convertkit' ),
'convertkit/' . $this->block->get_name(),
$this->block->get_title()
__( 'Inserts a new %s in a Page, Post or Custom Post\'s content. The element can be appended (default), prepended, or inserted relative to an existing element using a zero-based index.', 'convertkit' ),
$this->block->get_title_plural()

Check failure on line 63 in includes/mcp/abilities/content/class-convertkit-mcp-ability-content-insert.php

View workflow job for this annotation

GitHub Actions / Coding Standards / WordPress latest / PHP 7.4

Call to an undefined method ConvertKit_Block::get_title_plural().
);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@

return sprintf(
/* translators: %s: block title */
__( 'List %s elements in a post', 'convertkit' ),
$this->block->get_title()
__( 'List %s in a Post, Page or Custom Post', 'convertkit' ),
$this->block->get_title_plural()

Check failure on line 64 in includes/mcp/abilities/content/class-convertkit-mcp-ability-content-list.php

View workflow job for this annotation

GitHub Actions / Coding Standards / WordPress latest / PHP 7.4

Call to an undefined method ConvertKit_Block::get_title_plural().
);

}
Expand All @@ -76,10 +76,9 @@
public function get_description() {

return sprintf(
/* translators: 1: block full name e.g. convertkit/form, 2: block title */
__( 'Lists every occurrence of the %1$s (%2$s) element in the given post, including each occurrence\'s zero-based index and current attribute values.', 'convertkit' ),
'convertkit/' . $this->block->get_name(),
$this->block->get_title()
/* translators: Block Name */
__( 'Lists every %s in the given Post, Page or Custom Post, including each occurrence\'s zero-based index and current attribute values.', 'convertkit' ),
$this->block->get_title_plural()

Check failure on line 81 in includes/mcp/abilities/content/class-convertkit-mcp-ability-content-list.php

View workflow job for this annotation

GitHub Actions / Coding Standards / WordPress latest / PHP 7.4

Call to an undefined method ConvertKit_Block::get_title_plural().
);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

return sprintf(
/* translators: %s: block title */
__( 'Update an existing %s element in a post', 'convertkit' ),
__( 'Update Existing %s in a Page, Post or Custom Post', 'convertkit' ),
$this->block->get_title()
);

Expand All @@ -67,10 +67,9 @@
public function get_description() {

return sprintf(
/* translators: 1: block full name e.g. convertkit/form, 2: block title */
__( 'Updates the attributes of a single occurrence of the %1$s (%2$s) element in the given post. By default the provided attributes are merged into the existing attributes.', 'convertkit' ),
'convertkit/' . $this->block->get_name(),
$this->block->get_title()
/* translators: Block Name */
__( 'Updates the attributes of an existing %s in a Page, Post or Custom Post. The provided attributes are merged into the existing attributes.', 'convertkit' ),
$this->block->get_title_plural()

Check failure on line 72 in includes/mcp/abilities/content/class-convertkit-mcp-ability-content-update.php

View workflow job for this annotation

GitHub Actions / Coding Standards / WordPress latest / PHP 7.4

Call to an undefined method ConvertKit_Block::get_title_plural().
);

}
Expand Down
Loading
Loading