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/lookup_top_level_pages_first
Filter to place page lookups higher that base-less category slug lookups
Arguments
Argument | Type | Description |
---|---|---|
$lookup_top_level_pages_first | bool | default false |
$url | string | requested URL |
Changelog
Version | Description |
---|---|
4.0.4 |
Source: src/HeadlessFrontend/ResolveUrl.php, line 149
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 172
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 202
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
organic/syndication/feed_groups
Filters collects the feed groups configuration
Create you feed class, extend the SWPCore\Syndication\Feeds\AbstractFeed, override the abstract methods and add use this filter to add the configuration as the example below in your construct function: 'flipboard' => [ 'label' => 'Flipboard', 'rules' => [ //set of rewrite rules to be caught by feed router [ 'regex' => '^feeds/flipboard$', 'query' => 'feeds=flipboard', 'permalink' => 'feeds/flipboard', ], ], ];
Arguments
Argument | Type | Description |
---|---|---|
self::$feeds |
Source: src/Syndication/Syndication.php, line 45
organic/syndication/default_value
Arguments
Argument | Type | Description |
---|---|---|
[] |
Source: src/Syndication/AcfFieldsOption.php, line 82
organic/syndication/feed_status_default/{$name}
Filters feed status default value
Arguments
Argument | Type | Description |
---|---|---|
false |
Source: src/Syndication/AcfFieldsOption.php, line 92
organic/syndication/{$option_name}_default/{$name}
Filter to change default value of a feed's option Possible values:
organic/syndication/max_days_default/$name Filters feed maximum days default value param number $max_days. Default 10
organic/syndication/page_size_default/$name Filters feed page size default value param number $page_size. Default 100
Arguments
Argument | Type | Description |
---|---|---|
$default_value | mixed | Value of the option |
Source: src/Syndication/AcfFieldsOption.php, line 117
organic/syndication/options/sub_fields
Filter hook for option page sub fields.
Arguments
Argument | Type | Description |
---|---|---|
$sub_fields | array | list of current sub-fields. |
$name | string | name of the syndication. |
Source: src/Syndication/AcfFieldsOption.php, line 277
organic/syndication/options/sub_fields/{$name}
Arguments
Argument | Type | Description |
---|---|---|
$sub_fields |
Source: src/Syndication/AcfFieldsOption.php, line 284
organic/syndication/yahoo/allowed-tags
Filters the list of allowed HTML tags in Yahoo Feed
Arguments
Argument | Type | Description |
---|---|---|
['p', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'b', 'blockquote', 'br', 'em', 'i', 'img', 'li', 'ol', 'ul', 'strong', 'embed', 'iframe', 'sub', 'sup', 'pre', 'figure', 'figcaption', 'section', 'span', 'table', 'tr', 'th'] |
Source: src/Syndication/Feeds/YahooFeed.php, line 101
organic/syndication/yahoo/show_disclosure
Allows disabling disclosure text in Yahoo feed
Arguments
Argument | Type | Description |
---|---|---|
true |
Source: src/Syndication/Feeds/YahooFeed.php, line 145
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 158
organic/syndication/yahoo/show_media_content
Allows hiding the media content in Yahoo Feed
Arguments
Argument | Type | Description |
---|---|---|
true |
Source: src/Syndication/Feeds/YahooFeed.php, line 182
organic/syndication/feedhelper/query_args
Arguments
Argument | Type | Description |
---|---|---|
$args | array | query arguments |
static::get_feed_type() |
Source: src/Syndication/Feeds/AbstractFeed.php, line 48
organic/syndication/query_args/{$feed_name}
Filters syndication feed query arguments
Arguments
Argument | Type | Description |
---|---|---|
$args | array | query arguments |
Source: src/Syndication/Feeds/AbstractFeed.php, line 58
organic/syndication/smartnews/query_args
Arguments
Argument | Type | Description |
---|---|---|
$default_args |
Source: src/Syndication/Feeds/SmartNewsFeed.php, line 133
organic/syndication/smartnews_logo_url
Arguments
Argument | Type | Description |
---|---|---|
self::get_feed_type() | ||
$logo_url | string |
Source: src/Syndication/Feeds/SmartNewsFeed.php, line 252
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 66
organic/infinite_scroll/items_filter
Filters infinite scroll returned items
Arguments
Argument | Type | Description |
---|---|---|
$items | array | returned items |
Source: src/InfiniteScroll.php, line 267
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 308
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/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 73
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 291
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 409
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