Wordpress API Filter/Hook Reference
Actions
organic/syndication/feed_route/{$feed_type}
Hook to allow other feeds to catch the request.
Changelog
Version | Description |
---|---|
2.0.38 |
Source: src/Syndication/FeedRouter.php, line 194
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 549
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/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 50
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 79
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 114
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 470
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 575
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/controls_keys
Allows extending the $syndication_controls_keys
config
Arguments
Argument | Type | Description |
---|---|---|
$syndication_controls_keys | array |
Source: src/Syndication.php, line 104
organic/syndication/controls_types
Allows extending $syndication_controls_types
config
Arguments
Argument | Type | Description |
---|---|---|
$syndication_controls_types | array |
Source: src/Syndication.php, line 135
organic/syndication/key_scheme
Allows extending the SQuery->key_scheme
config
Arguments
Argument | Type | Description |
---|---|---|
$key_scheme | array |
Source: src/Syndication/SQuery.php, line 38
organic/syndication/query
Allows modyfing query object in syndication feeds
Arguments
Argument | Type | Description |
---|---|---|
$query | \WP_Query |
Source: src/Syndication/SQuery.php, line 114
organic/syndication/acf_fields
Allows extending Syndication-related ACF fields
Arguments
Argument | Type | Description |
---|---|---|
$fields | array | key -> label array mapping |
Source: src/Syndication/AcfFieldsOption.php, line 24
organic/syndication/default_value
Filters publishing defaults mapping
Arguments
Argument | Type | Description |
---|---|---|
$defaults | array | feed_key => publish|no_publish array |
Source: src/Syndication/AcfFieldsOption.php, line 153
organic/syndication/feed_groups
Allows extending the $feed_groups
config
Arguments
Argument | Type | Description |
---|---|---|
self::FEED_GROUPS |
Changelog
Version | Description |
---|---|
2.0.38 |
Source: src/Syndication/FeedRouter.php, line 122
organic/syndication/feedhelper/query_args
Filters syndication feed query arguments
Arguments
Argument | Type | Description |
---|---|---|
$args | array | query arguments |
$type | string | feed type |
Source: src/Syndication/Feeds/FeedHelper.php, line 78
organic/syndication/yahoo/allowed-tags
Filters the list of allowed HTML tags in Yahoo Feed
Arguments
Argument | Type | Description |
---|---|---|
$allowed_html_tags | array | list of HTML tags |
Source: src/Syndication/Feeds/YahooFeed.php, line 106
organic/syndication/yahoo/show_disclosure
Allows disabling disclosure text in Yahoo feed
Arguments
Argument | Type | Description |
---|---|---|
$should_add | bool | default true |
Source: src/Syndication/Feeds/YahooFeed.php, line 120
organic/syndication/yahoo/content
Content filter for Yahoo Feed
Arguments
Argument | Type | Description |
---|---|---|
$content | string | default $post->post_content |
Source: src/Syndication/Feeds/YahooFeed.php, line 133
organic/syndication/yahoo/show_media_content
Allows hiding the media content in Yahoo Feed
Arguments
Argument | Type | Description |
---|---|---|
$show_media_content | bool | default true |
Source: src/Syndication/Feeds/YahooFeed.php, line 157
organic/syndication/smartnews/query_args
Filters SmartNews Feed query args
Arguments
Argument | Type | Description |
---|---|---|
$args | array | query args |
Source: src/Syndication/Feeds/SmartNewsFeed.php, line 49
organic/syndication/smartnews_logo_url
Adds custom SmartNews Feed logo if it's empty
Should return URL of logo
Arguments
Argument | Type | Description |
---|---|---|
$feed_type | string |
Source: src/Syndication/Feeds/SmartNewsFeed.php, line 227
organic/author/load_more
Returns Author's posts html while clicking Load More
Arguments
Argument | Type | Description |
---|---|---|
$content | string | default '' |
$author | \SWPCore\Authors\Author|null | |
$posts | array | next portion of posts |
Source: src/Authors/AuthorSupport.php, line 376
organic/author/profile_schema
Organic hook filter to modify the ProfilePage schema.
Arguments
Argument | Type | Description |
---|---|---|
$authorSchema | array | array data of the current schema. |
$authorData | array | array of the currently viewed author's custom metas. |
$author | \WP_Term | term object of the currently viewed author. |
Source: src/Authors/AuthorSupport.php, line 584
organic/author_tag/create_from_term
Allows extending Author Term
Arguments
Argument | Type | Description |
---|---|---|
$term | \WP_Term | author term |
Source: src/Authors/Author.php, line 34
organic/infinite_scroll/load_more
Returns infinite scroll load_more
action content
Arguments
Argument | Type | Description |
---|---|---|
$content | string | |
$query | array | WP_Query args |
$exclude_ids | array | list of post ids to exclude |
$term_id | int|null | Term ID |
$layout | string | default 'default' |
Source: src/InfiniteScroll.php, line 65
organic/infinite_scroll/items_filter
Filters infinite scroll returned items
Arguments
Argument | Type | Description |
---|---|---|
$items | array | returned items |
Source: src/InfiniteScroll.php, line 266
organic/infinite_scroll/items_html
Required filter to enable infinite scroll feature
Renders item html
Arguments
Argument | Type | Description |
---|---|---|
$content | string | default '' |
$post_data | array | post_data from SinglePost::getArticleData() |
Source: src/InfiniteScroll.php, line 307
organic/product_card_link
Filters product card link
Arguments
Argument | Type | Description |
---|---|---|
$url | string | product link |
Source: src/ProductCard.php, line 162
organic/pinterest_share_icon
Filters Pinterest icon
Arguments
Argument | Type | Description |
---|---|---|
$share_icon | string | html of icon <i>..</i> |
$class_name | string | class name of base image component. default orgnc-SingleImage |
Changelog
Version | Description |
---|---|
2.0.33 | renamed from swp_core_pinterest_share_icon |
Source: src/SinglePost.php, line 553
organic/category/load_more
Filter to hook into category's load more XHR request
Arguments
Argument | Type | Description |
---|---|---|
$article_html | string | default '' |
$post | \WP_Post |
Source: src/Actions/TaxonomyAction.php, line 169
organic/manage_{$taxonomy}_custom_fields
Filter allowing to add taxonomy term custom fields in manage view
Arguments
Argument | Type | Description |
---|---|---|
$customFields | array | Array of [$key => $label] items. Default [] |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from swp_manage_{$taxonomy}_custom_fields |
Source: src/Actions/TaxonomyAction.php, line 239
organic/allow_nested_category_path_in_post_permalink
Filter for enabling nested category URL path in a post permalink
Arguments
Argument | Type | Description |
---|---|---|
$category_path_is_nested | bool | default false |
Changelog
Version | Description |
---|---|
2.0.36 | filter was added |
Source: src/Actions/PostAction.php, line 290
organic/prevent_post_update
Filter to allow preventing post_modified
modification (for example in management commands)
Arguments
Argument | Type | Description |
---|---|---|
$enabled | bool | default true |
Changelog
Version | Description |
---|---|
2.0.33 | Renamed from swp_core_action_prevent_post_update |
Source: src/Actions/PostAction.php, line 408
organic/plugins/disable_locally
Filters the list of plugins to disable locally
Arguments
Argument | Type | Description |
---|---|---|
$localPluginsBasenames | string[] | array of plugin basenames |
Source: src/PluginsControl.php, line 23