com um clique
integrations
// Third-party WordPress plugin integration patterns. Use when adding new integrations, debugging compatibility with other plugins, or working with existing integrations.
// Third-party WordPress plugin integration patterns. Use when adding new integrations, debugging compatibility with other plugins, or working with existing integrations.
ActivityPub protocol specification and federation concepts. Use when working with ActivityPub activities, understanding federation mechanics, implementing protocol features, or debugging federation issues.
Use when auditing or updating .gitattributes export-ignore coverage so dev-only files (lint configs, CI, tests, docs, build tooling) don't ship in the WordPress.org plugin zip. Run before a release, after adding a new top-level file or config, or when a tool is renamed (e.g. .eslintrc.js → eslint.config.cjs).
Use when auditing or updating .gitattributes export-ignore coverage so dev-only files (lint configs, CI, tests, docs, build tooling) don't ship in the WordPress.org plugin zip. Run before a release, after adding a new top-level file or config, or when a tool is renamed (e.g. .eslintrc.js → eslint.config.cjs).
INVOKE THIS SKILL before creating any PR to ensure compliance with branch naming, changelog requirements, and reviewer assignment.
PHP coding standards and WordPress patterns for ActivityPub plugin. Use when writing PHP code, creating classes, implementing WordPress hooks, or structuring plugin files.
Development workflows for WordPress ActivityPub plugin including wp-env setup, testing commands, linting, and build processes. Use when setting up development environment, running tests, checking code quality, building assets, or working with wp-env.
| name | integrations |
| description | Third-party WordPress plugin integration patterns. Use when adding new integrations, debugging compatibility with other plugins, or working with existing integrations. |
This skill provides guidance on integrating the ActivityPub plugin with other WordPress plugins.
All integrations live in the integration/ directory.
File naming: class-{plugin-name}.php (following PHP conventions in AGENTS.md)
For complete directory structure and naming conventions, see docs/php-class-structure.md.
<?php
namespace Activitypub\Integration;
class Plugin_Name {
public static function init() {
\add_filter( 'activitypub_transformer', array( self::class, 'custom_transformer' ), 10, 2 );
\add_filter( 'activitypub_post_types', array( self::class, 'add_post_types' ) );
}
public static function custom_transformer( $transformer, $object ) {
// Return custom transformer if needed.
return $transformer;
}
public static function add_post_types( $post_types ) {
// Add plugin's post types.
$post_types[] = 'plugin_post_type';
return $post_types;
}
}
public static function add_post_types( $post_types ) {
$post_types[] = 'event';
$post_types[] = 'product';
return $post_types;
}
public static function transformer( $transformer, $object ) {
if ( 'custom_type' === get_post_type( $object ) ) {
require_once __DIR__ . '/transformer/class-custom.php';
return new Transformer\Custom( $object );
}
return $transformer;
}
\add_filter( 'activitypub_activity_object', function( $object, $post ) {
if ( 'product' === get_post_type( $post ) ) {
$object['type'] = 'Product';
$object['price'] = get_post_meta( $post->ID, 'price', true );
}
return $object;
}, 10, 2 );
// Check if integration is active.
if ( class_exists( '\Activitypub\Integration\Plugin_Name' ) ) {
// Integration loaded.
}
// Multiple detection methods.
if ( defined( 'PLUGIN_VERSION' ) ) { }
if ( function_exists( 'plugin_function' ) ) { }
if ( class_exists( 'Plugin_Class' ) ) { }
// Use appropriate priority.
add_filter( 'hook', 'callback', 20 ); // After plugin's filter.
// Use fully qualified names.
$object = new \Plugin\Namespace\Class();