Skip to main content

Hooks of the components

Beside the hooks of the core, which every component shares (Actions, Filters), some components run hooks of their own, read from the code. None of them is on the stable list yet. The comment above each place in the code says what it is for. For which hook changes what, see Changing a component.

Courses​

3 hooks of its own, in kits/courses/.

poly_community_course_finish​

function my_plugin_course_finish( $course, $standing ) {
// …
}
add_action( 'poly_community_course_finish', 'my_plugin_course_finish', 10, 2 );

Runs in kits/courses/views/course-finish.php:53.

poly_community_course_finished​

function my_plugin_course_finished( $course_id, $context_profile_id, $context ) {
// …
}
add_action( 'poly_community_course_finished', 'my_plugin_course_finished', 10, 3 );
ArgumentAs the plugin passes it
$course_id(int) $course_id
$context_profile_id(int) $context['profile_id']
$context$context

Runs in kits/courses/inc/trait-progress.php:505.

poly_community_course_lesson_kinds​

function my_plugin_course_lesson_kinds( $value ) {
return $value;
}
add_filter( 'poly_community_course_lesson_kinds', 'my_plugin_course_lesson_kinds' );
ArgumentAs the plugin passes it
$valueself::OFFERED

Runs in kits/courses/kit.php:626.

Events​

6 hooks of its own, in kits/events/.

poly_community_event_attachments​

function my_plugin_event_attachments( $value ) {
return $value;
}
add_filter( 'poly_community_event_attachments', 'my_plugin_event_attachments' );
ArgumentAs the plugin passes it
$valuearray()

Runs in kits/events/inc/trait-rest.php:289, kits/events/inc/trait-series.php:562, kits/events/kit.php:226.

poly_community_event_checkin_names​

function my_plugin_event_checkin_names( $value ) {
return $value;
}
add_filter( 'poly_community_event_checkin_names', 'my_plugin_event_checkin_names' );
ArgumentAs the plugin passes it
$value1000

Runs in kits/events/inc/trait-answers.php:322.

poly_community_event_form_sections​

function my_plugin_event_form_sections( $value, $item, $event ) {
return $value;
}
add_filter( 'poly_community_event_form_sections', 'my_plugin_event_form_sections', 10, 3 );
ArgumentAs the plugin passes it
$valuearray()
$item$item
$event$event

Runs in kits/events/views/form-more.php:212.

poly_community_event_join_sources​

function my_plugin_event_join_sources( $sources ) {
return $sources;
}
add_filter( 'poly_community_event_join_sources', 'my_plugin_event_join_sources' );

Runs in kits/events/inc/trait-join.php:85.

poly_community_event_offer_seconds​

function my_plugin_event_offer_seconds( $value ) {
return $value;
}
add_filter( 'poly_community_event_offer_seconds', 'my_plugin_event_offer_seconds' );
ArgumentAs the plugin passes it
$valueDAY_IN_SECONDS

Runs in kits/events/inc/class-store.php:672.

poly_community_event_series_months​

function my_plugin_event_series_months( $value ) {
return $value;
}
add_filter( 'poly_community_event_series_months', 'my_plugin_event_series_months' );
ArgumentAs the plugin passes it
$value6

Runs in kits/events/inc/trait-series.php:190.

Listings​

One hook of its own, in kits/listings/.

poly_community_listing_directions_url​

function my_plugin_listing_directions_url( $url, $place ) {
return $url;
}
add_filter( 'poly_community_listing_directions_url', 'my_plugin_listing_directions_url', 10, 2 );

Runs in kits/listings/inc/trait-page.php:143.

Votes​

One hook of its own, in kits/votes/.

poly_community_idea_status​

function my_plugin_idea_status( $item_id, $slug, $arg3, $context_profile_id ) {
// …
}
add_action( 'poly_community_idea_status', 'my_plugin_idea_status', 10, 4 );
ArgumentAs the plugin passes it
$item_id(int) $item->id
$slug$slug
$arg3$before ? $before['slug'] : ''
$context_profile_id(int) $context['profile_id']

Runs in kits/votes/inc/trait-ideas.php:161.

Matching​

3 hooks of its own, in kits/matching/.

poly_community_matching_age_class​

function my_plugin_matching_age_class( $class, $profile_id, $facts ) {
return $class;
}
add_filter( 'poly_community_matching_age_class', 'my_plugin_matching_age_class', 10, 3 );
ArgumentAs the plugin passes it
$class$class
$profile_id(int) $profile_id
$facts$facts

Runs in kits/matching/inc/trait-scope.php:150.

poly_community_matching_age_sql​

function my_plugin_matching_age_sql( $value ) {
return $value;
}
add_filter( 'poly_community_matching_age_sql', 'my_plugin_matching_age_sql' );
ArgumentAs the plugin passes it
$valuearray( 'minor' => $minor, 'adult' => $adult )

Runs in kits/matching/inc/trait-scope.php:177.

poly_community_matching_minors_meet​

function my_plugin_matching_minors_meet( $value ) {
return $value;
}
add_filter( 'poly_community_matching_minors_meet', 'my_plugin_matching_minors_meet' );
ArgumentAs the plugin passes it
$valuefalse

Runs in kits/matching/inc/trait-scope.php:193.

Member types​

One hook of its own, in kits/member-types/.

poly_community_member_type_changed​

function my_plugin_member_type_changed( $profile_id, $arg2, $arg3, $args_by ) {
// …
}
add_action( 'poly_community_member_type_changed', 'my_plugin_member_type_changed', 10, 4 );
ArgumentAs the plugin passes it
$profile_id(int) $profile->id
$arg2$after ? $after['slug'] : ''
$arg3$before ? $before['slug'] : ''
$args_by(int) $args['by']

Runs in kits/member-types/inc/trait-members.php:58.

Organizations​

2 hooks of its own, in kits/organizations/.

poly_community_organization_created​

function my_plugin_organization_created( $id, $context_user_id ) {
// …
}
add_action( 'poly_community_organization_created', 'my_plugin_organization_created', 10, 2 );
ArgumentAs the plugin passes it
$id$id
$context_user_id(int) $context['user_id']

Runs in kits/organizations/inc/trait-writes.php:127.

poly_community_organization_deleted​

function my_plugin_organization_deleted( $id, $keep ) {
// …
}
add_action( 'poly_community_organization_deleted', 'my_plugin_organization_deleted', 10, 2 );

Runs in kits/organizations/inc/trait-writes.php:524.

10 hooks of its own, in kits/payments/.

poly_community_billing_entitlement_shown​

function my_plugin_billing_entitlement_shown( $value, $entitlement ) {
return $value;
}
add_filter( 'poly_community_billing_entitlement_shown', 'my_plugin_billing_entitlement_shown', 10, 2 );
ArgumentAs the plugin passes it
$valuetrue
$entitlement$entitlement

Runs in kits/payments/inc/trait-blocks.php:420, kits/payments/views/billing.php:22.

poly_community_billing_more​

function my_plugin_billing_more( $me, $args_context ) {
// …
}
add_action( 'poly_community_billing_more', 'my_plugin_billing_more', 10, 2 );
ArgumentAs the plugin passes it
$me$me
$args_context$args['context']

Runs in kits/payments/views/billing.php:92.

poly_community_pay_can_buy​

function my_plugin_pay_can_buy( $value, $user_id, $product, $price, $args ) {
return $value;
}
add_filter( 'poly_community_pay_can_buy', 'my_plugin_pay_can_buy', 10, 5 );
ArgumentAs the plugin passes it
$value$no( 'no_product', _x( 'That is no longer on sale.', 'REST error', 'poly-community' ), 404 )
$user_id$user_id
$product$product
$price$price
$args$args

Runs in kits/payments/inc/trait-sync.php:116.

poly_community_pay_describe​

function my_plugin_pay_describe( $said, $product ) {
return $said;
}
add_filter( 'poly_community_pay_describe', 'my_plugin_pay_describe', 10, 2 );

Runs in kits/payments/inc/trait-sync.php:211.

poly_community_pay_released​

function my_plugin_pay_released( $order ) {
// …
}
add_action( 'poly_community_pay_released', 'my_plugin_pay_released' );

Runs in kits/payments/inc/trait-sync.php:95.

poly_community_paywall_held​

function my_plugin_paywall_held( $value, $item, $product, $context ) {
return $value;
}
add_filter( 'poly_community_paywall_held', 'my_plugin_paywall_held', 10, 4 );
ArgumentAs the plugin passes it
$valuefalse
$item$item
$product$product
$context$context

Runs in kits/payments/kit.php:239.

poly_community_paywall_teaser​

function my_plugin_paywall_teaser( $value, $item, $other, $context ) {
return $value;
}
add_filter( 'poly_community_paywall_teaser', 'my_plugin_paywall_teaser', 10, 4 );
ArgumentAs the plugin passes it
$value'<p class="poly-teaser">' . esc_html_x( 'This post is for some members only.', 'Post teaser', 'poly-community' ) . '</p>'
$item$item
$other$other
$context$context

Runs in kits/payments/inc/trait-blocks.php:321.

poly_community_paywall_text​

function my_plugin_paywall_text( $value, $item, $other ) {
return $value;
}
add_filter( 'poly_community_paywall_text', 'my_plugin_paywall_text', 10, 3 );
ArgumentAs the plugin passes it
$value_x( 'This post is for some members only.', 'Post teaser', 'poly-community' )
$item$item
$other$other

Runs in kits/payments/kit.php:462.

poly_community_space_plan_sets​

function my_plugin_space_plan_sets( $value, $space ) {
return $value;
}
add_filter( 'poly_community_space_plan_sets', 'my_plugin_space_plan_sets', 10, 2 );
ArgumentAs the plugin passes it
$valuearray( Poly_Community()->money->space_plans( $space ) )
$space$space

Runs in kits/payments/kit.php:517.

poly_community_space_plans_sql​

function my_plugin_space_plans_sql( $value, $context, $alias, $team ) {
return $value;
}
add_filter( 'poly_community_space_plans_sql', 'my_plugin_space_plans_sql', 10, 4 );
ArgumentAs the plugin passes it
$value''
$context$context
$alias$alias
$team$team

Runs in kits/payments/kit.php:337.

Ratings and warnings​

5 hooks of its own, in kits/ratings/.

poly_community_item_pictures​

function my_plugin_item_pictures( $has, $args ) {
return $has;
}
add_filter( 'poly_community_item_pictures', 'my_plugin_item_pictures', 10, 2 );

Runs in kits/ratings/kit.php:807.

poly_community_item_rated​

function my_plugin_item_rated( $item_id, $rating, $now_r, $by ) {
// …
}
add_action( 'poly_community_item_rated', 'my_plugin_item_rated', 10, 4 );
ArgumentAs the plugin passes it
$item_id(int) $item->id
$rating$rating
$now_r$now['r']
$by$by

Runs in kits/ratings/kit.php:1108.

poly_community_ratings_minor​

function my_plugin_ratings_minor( $value, $user_id, $arg3 ) {
return $value;
}
add_filter( 'poly_community_ratings_minor', 'my_plugin_ratings_minor', 10, 3 );
ArgumentAs the plugin passes it
$valuefalse
$user_id$user_id
$arg3$row ? (int) $row->age_band : 0

Runs in kits/ratings/kit.php:330.

poly_community_ratings_vouched​

function my_plugin_ratings_vouched( $value, $user_id ) {
return $value;
}
add_filter( 'poly_community_ratings_vouched', 'my_plugin_ratings_vouched', 10, 2 );
ArgumentAs the plugin passes it
$valuefalse
$user_id$user_id

Runs in kits/ratings/kit.php:340.

poly_community_viewer_country​

function my_plugin_viewer_country( $value, $user_id ) {
return $value;
}
add_filter( 'poly_community_viewer_country', 'my_plugin_viewer_country', 10, 2 );
ArgumentAs the plugin passes it
$value(string) $this->choices_of( (int) $user_id )['country']
$user_id(int) $user_id

Runs in kits/ratings/inc/trait-adult.php:51.

Trust levels​

2 hooks of its own, in kits/trust/.

poly_community_action_asked​

function my_plugin_action_asked( $value, $action ) {
return $value;
}
add_filter( 'poly_community_action_asked', 'my_plugin_action_asked', 10, 2 );
ArgumentAs the plugin passes it
$valuefalse
$action$action

Runs in kits/trust/kit.php:201.

poly_community_trust_level_changed​

function my_plugin_trust_level_changed( $user_id, $after, $before ) {
// …
}
add_action( 'poly_community_trust_level_changed', 'my_plugin_trust_level_changed', 10, 3 );

Runs in kits/trust/inc/trait-levels.php:448.