Wordpress API Filter/Hook Reference
Actions
organic/syndication/update_post_feed_status/{$type}
Action fired after post feed status have been updated
Arguments
Argument | Type | Description |
---|---|---|
$post_id | int | post id |
$status | int | the new status (0 or 1) |
Changelog
Version | Description |
---|---|
3.0.19 | renamed from "organic/actions/update_post_feed_status_$type" |
2.0.33 | renamed from "organic_update_post_feed_status_$type" |
Source: src/Syndication/SQuery.php, line 243
organic/actions/update_post_feed_status_{$type}
Arguments
Argument | Type | Description |
---|---|---|
$post_id | ||
$status |
Source: src/Syndication/SQuery.php, line 253
organic/syndication/feed_route/{$feed_type}
Hook to render the feed or allow feeds to catch the request.
Changelog
Version | Description |
---|---|
2.0.38 |
Source: src/Syndication/FeedRouter.php, line 52
organic/actions/update_post_feed_status_{$type}
Action fired after post feed status have been updated
Arguments
Argument | Type | Description |
---|---|---|
$post_id | int | post id |
$status | int | the new status (0 or 1) |
Changelog
Version | Description |
---|---|
2.0.33 | renamed from "organic_update_post_feed_status_$type" |
Source: src/helpers.php, line 586
organic/media/attachment_focus_area_updated
Hook fired after image has its focus area updated.
Arguments
Argument | Type | Description |
---|---|---|
$attachID | int | Updated attachment ID |
Changelog
Version | Description |
---|---|
2.0.82 |
Source: src/Media.php, line 75
Filters
organic/product-summary/link-color
Filters product summary link color.
Arguments
Argument | Type | Description |
---|---|---|
$color | string | CSS color. Default 'inherit' |
Source: src/Blocks/ProductSummary.php, line 89
organic/product-summary/link-underline-color
Filters product summary link underline color.
Arguments
Argument | Type | Description |
---|---|---|
$color | string | CSS color. Default 'inherit' |
Source: src/Blocks/ProductSummary.php, line 100
organic/product_card_badges
Determines should product card have badges or not
Arguments
Argument | Type | Description |
---|---|---|
$badges | array|null | default null |
Source: src/Blocks/ProductCard.php, line 96
organic/product_card_image_alt
Filters product card image alt
Arguments
Argument | Type | Description |
---|---|---|
$image_alt | string | Image alt |
$attachment_id | int | Attachment ID |
Source: src/Blocks/ProductCard.php, line 385
organic/product-table/cta-text-color
Filters the Product Table Call-To-Action button text color
Arguments
Argument | Type | Description |
---|---|---|
$cta_text_color | string | CSS color. Default black |
Source: src/Blocks/ProductTable.php, line 21
organic/product-table/cta-bg-color
Filters the Product Table Call-To-Action button background color
Arguments
Argument | Type | Description |
---|---|---|
$cta_bg_color | string | CSS color. Default lightgray |
Source: src/Blocks/ProductTable.php, line 32
organic/render_block/{$block_name}
Custom renderer for $block_name
Arguments
Argument | Type | Description |
---|---|---|
$value | string | Rendered block string. Default '' |
$render_context | array | Array of render context |
Source: src/Blocks/AcfBlockBase.php, line 44
organic/render_block
General filter for rendering blocks
Arguments
Argument | Type | Description |
---|---|---|
$value | string | Rendered block string. Default '' |
$block_name | string | Block name. Example: acf/product-card |
$render_context | array | Array of render context |
Source: src/Blocks/AcfBlockBase.php, line 56
organic/sharable-pull-quote/sharable-pull-quote-share-color
Filters the Sharable Pull Quote Block text color
Arguments
Argument | Type | Description |
---|---|---|
$color | string | CSS color. Default #8f9fcc |
Source: src/Blocks/SharablePullQuote.php, line 23
organic/sharable-pull-quote/sharable-pull-quote-text-font
Filters the Sharable Pull Quote Block text font
Arguments
Argument | Type | Description |
---|---|---|
$text_font | string | font family. Default inherit |
Source: src/Blocks/SharablePullQuote.php, line 34
organic/image_with_caption/caption_color
Filters the Image With Caption Block caption text color
Arguments
Argument | Type | Description |
---|---|---|
$caption_color | string | color. Default #17878f |
Source: src/Blocks/ImageWithSubtitle.php, line 22
organic/image_with_caption/figcaption_border_color
Filters the Image With Caption Block border color
Arguments
Argument | Type | Description |
---|---|---|
$border_color | string | color. Default gray |
Source: src/Blocks/ImageWithSubtitle.php, line 33
organic/image_with_caption/figcaption_link_color
Filters the Image With Caption Block link color
Arguments
Argument | Type | Description |
---|---|---|
$link_color | string | color. Default black |
Source: src/Blocks/ImageWithSubtitle.php, line 44
organic/post-connection-query-args/{$contentKind}
Allows modifying WP query params for posts connection query, depends on the content kind contentKind: category, tag, author, author_plural, block, search.
For example, organic/post-connection-query-args/category, organic/post-connection-query-args/tag Should return $queryArgs
Arguments
Argument | Type | Description |
---|---|---|
$queryArgs | array | The args that will be passed to the WP_Query |
ResolveUrl::$getParams | ||
$source | mixed | The source that's passed down the GraphQL queries |
$args | array | The inputArgs on the field |
$context | \WPGraphQL\AppContext | The AppContext passed down the GraphQL tree |
$info | \GraphQL\Type\Definition\ResolveInfo | The ResolveInfo passed down the GraphQL tree |
Source: src/HeadlessFrontend/PostObjectConnectionQueryArgs.php, line 27
organic/infinite_scroll/next_post_id
Optional filter to override existing method of getting next post in the infinite scroll feed
Return post ID or null to use default method
Arguments
Argument | Type | Description |
---|---|---|
null | ||
$previousArticles | array | IDs or previous displayed posts` |
Source: src/HeadlessFrontend/InfiniteScrollArticles.php, line 67
organic/query_args/author_plural
Arguments
Argument | Type | Description |
---|---|---|
$query_args |
Source: src/HeadlessFrontend/Authors.php, line 32
organic/query_args/author_plural
Arguments
Argument | Type | Description |
---|---|---|
$where_args |
Source: src/HeadlessFrontend/Authors.php, line 97
organic/newsletter_signup
Arguments
Argument | Type | Description |
---|---|---|
[false, ''] | ||
$input | ||
$context | ||
$info |
Source: src/HeadlessFrontend/GraphqlEndpoints/NewsletterSignup.php, line 43
organic/filter_request_arguments_{$name}
Arguments
Argument | Type | Description |
---|---|---|
$args | ||
$event->attributes |
Source: src/HeadlessFrontend/helpers.php, line 24
organic/resolve_url
Optional filter to override headless resolveUrl method
Return post ID or null to use default method
Arguments
Argument | Type | Description |
---|---|---|
null | ||
$url | string | requested URL |
Source: src/HeadlessFrontend/ResolveUrl.php, line 112
organic/resolve_url/custom_url
Allows adding custom resolving logic for redirection.
For example, /category/numeric-id
url without the post slug
Should return structure like
[
'status' => 301, 'location' => '...proper url...', 'node' => null,
]
if you want return redirection
Arguments
Argument | Type | Description |
---|---|---|
$value | array|null | filtered value. Default value null |
$url | string | Resolving URL |
Changelog
Version | Description |
---|---|
2.0.33 | Old hook name: swp_core_frontend_resolve_handle_specify_url |
Source: src/HeadlessFrontend/ResolveUrl.php, line 154
organic/resolve_url/enable_slug_only_redirection
Enables auto-redirection by post slug only in uri
for example /slug-1 will be redirected to /primary-category/slug-1
Arguments
Argument | Type | Description |
---|---|---|
$value | bool | filtered value. Default value false |
Changelog
Version | Description |
---|---|
2.0.67 |
Source: src/HeadlessFrontend/ResolveUrl.php, line 184
organic/filters/content/format_links
Allows to disable automatic links normalization
By default it:
- adds https:// to the start of the link
- adds target="_blank" to external links
- adds target="_self" to internal links
Arguments
Argument | Type | Description |
---|---|---|
$value | bool | true if you want format all links. Default value true |
Source: src/Filters/ContentFilter.php, line 18
organic/allow_create_taxonomies_on_post_edit
List of taxonomies which are not allowed to be created directly from post-edit page.
Arguments
Argument | Type | Description |
---|---|---|
['internal_tag', 'category'] |
Source: src/Filters/TaxonomyFilter.php, line 202
organic/block_args/{$block_type}
Arguments
Argument | Type | Description |
---|---|---|
$args |
Source: src/Filters/BlockFilter.php, line 129
organic/robots_disallow
Allows disabling search engine crawling in robots.txt
Arguments
Argument | Type | Description |
---|---|---|
$disallow | bool | the value is evaluated dynamically |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from swp_core_robots_disallow |
Source: src/Filters/SEOFilter.php, line 51
organic/robots_disallow_search
Allows to disable search engine crawling at /search/
url(s)
Sometimes it's needed to open this url to de-index some search resuls
Arguments
Argument | Type | Description |
---|---|---|
$disallow_search | bool | Default true |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from swp_core_robots_disallow_search |
Source: src/Filters/SEOFilter.php, line 80
organic/robots_rules
Filters the robots.txt contents before sitemap section
You may extend the default robots.txt contents here
Arguments
Argument | Type | Description |
---|---|---|
$output | string | robots.txt contents |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from swp_core_robots_rules |
Source: src/Filters/SEOFilter.php, line 115
organic/graphql/json_ld_schemas
Allows adding your custom JSON schemas to the array of schemas
You should append your schema to the $schemas argument
Arguments
Argument | Type | Description |
---|---|---|
$schemas | array | array of JSON schemas |
$post | \WP_Post | current post |
Source: src/Filters/SEOFilter.php, line 471
organic/sitemap_news_trailing_slash_url
Allows to add trailing slash to the sitemap URLs
Arguments
Argument | Type | Description |
---|---|---|
$has_trailing_slash | bool | default false |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from organic_sitemap_news_trailing_slash_url |
Source: src/Filters/SEOFilter.php, line 576
organic/pelcro/initialize_ui_script
Allows to override Pelcro initialization script
Arguments
Argument | Type | Description |
---|---|---|
$initialization_script | string | default init script |
Source: src/Options/Pelcro.php, line 133
organic/related_stories_status
Allows overriding related stories status
true - related false - not related
Arguments
Argument | Type | Description |
---|---|---|
$is_related | bool | default true |
$post_id | int | Post ID |
Source: src/Options/General/PostOptions.php, line 115
organic/acf-post-sponsored-extra-fields
Allows extending ACF Group of Sponsored Fields
Arguments
Argument | Type | Description |
---|---|---|
$group | \StoutLogic\AcfBuilder\FieldsBuilder | the group object |
Source: src/Options/SponsoredRender.php, line 106
organic/mandatory_fields_options
Allows extending the mandatory fields options
Arguments
Argument | Type | Description |
---|---|---|
$configs | array | mandatory fields config |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from organic_mandatory_fields_options |
Source: src/Options/MandatoryField.php, line 106
organic/syndication/query
Allows modyfing query object in syndication feeds
Arguments
Argument | Type | Description |
---|---|---|
$query | \WP_Query |
Source: src/Syndication/SQuery.php, line 90