Skip to main content

Wordpress API Filter/Hook Reference

Actions

organic/syndication/feed_route/{$feed_type}

Hook to allow other feeds to catch the request.

Changelog

VersionDescription
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

ArgumentTypeDescription
$post_idintpost id
$statusintthe new status (0 or 1)

Changelog

VersionDescription
2.0.33renamed 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

ArgumentTypeDescription
$attachIDintUpdated attachment ID

Changelog

VersionDescription
2.0.82

Source: src/Media.php, line 75

Filters

Filters product summary link color.

Arguments

ArgumentTypeDescription
$colorstringCSS color. Default 'inherit'

Source: src/Blocks/ProductSummary.php, line 89

Filters product summary link underline color.

Arguments

ArgumentTypeDescription
$colorstringCSS color. Default 'inherit'

Source: src/Blocks/ProductSummary.php, line 100

organic/product_card_badges

Determines should product card have badges or not

Arguments

ArgumentTypeDescription
$badgesarray|nulldefault null

Source: src/Blocks/ProductCard.php, line 96

organic/product_card_image_alt

Filters product card image alt

Arguments

ArgumentTypeDescription
$image_altstringImage alt
$attachment_idintAttachment 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

ArgumentTypeDescription
$cta_text_colorstringCSS 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

ArgumentTypeDescription
$cta_bg_colorstringCSS color. Default lightgray

Source: src/Blocks/ProductTable.php, line 32

organic/render_block/{$block_name}

Custom renderer for $block_name

Arguments

ArgumentTypeDescription
$valuestringRendered block string. Default ''
$render_contextarrayArray of render context

Source: src/Blocks/AcfBlockBase.php, line 44

organic/render_block

General filter for rendering blocks

Arguments

ArgumentTypeDescription
$valuestringRendered block string. Default ''
$block_namestringBlock name. Example: acf/product-card
$render_contextarrayArray 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

ArgumentTypeDescription
$colorstringCSS 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

ArgumentTypeDescription
$text_fontstringfont 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

ArgumentTypeDescription
$caption_colorstringcolor. 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

ArgumentTypeDescription
$border_colorstringcolor. Default gray

Source: src/Blocks/ImageWithSubtitle.php, line 33

Filters the Image With Caption Block link color

Arguments

ArgumentTypeDescription
$link_colorstringcolor. 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

ArgumentTypeDescription
$queryArgsarrayThe args that will be passed to the WP_Query
ResolveUrl::$getParams
$sourcemixedThe source that's passed down the GraphQL queries
$argsarrayThe inputArgs on the field
$context\WPGraphQL\AppContextThe AppContext passed down the GraphQL tree
$info\GraphQL\Type\Definition\ResolveInfoThe 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

ArgumentTypeDescription
null
$previousArticlesarrayIDs or previous displayed posts`

Source: src/HeadlessFrontend/InfiniteScrollArticles.php, line 67

organic/query_args/author_plural

Arguments

ArgumentTypeDescription
$query_args

Source: src/HeadlessFrontend/Authors.php, line 32

organic/query_args/author_plural

Arguments

ArgumentTypeDescription
$where_args

Source: src/HeadlessFrontend/Authors.php, line 97

organic/newsletter_signup

Arguments

ArgumentTypeDescription
[false, '']
$input
$context
$info

Source: src/HeadlessFrontend/GraphqlEndpoints/NewsletterSignup.php, line 43

organic/filter_request_arguments_{$name}

Arguments

ArgumentTypeDescription
$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

ArgumentTypeDescription
null
$urlstringrequested 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

ArgumentTypeDescription
$valuearray|nullfiltered value. Default value null
$urlstringResolving URL

Changelog

VersionDescription
2.0.33Old 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

ArgumentTypeDescription
$valueboolfiltered value. Default value false

Changelog

VersionDescription
2.0.67

Source: src/HeadlessFrontend/ResolveUrl.php, line 184

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

ArgumentTypeDescription
$valuebooltrue 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

ArgumentTypeDescription
$disallowboolthe value is evaluated dynamically

Changelog

VersionDescription
2.0.33Renamed from swp_core_robots_disallow

Source: src/Filters/SEOFilter.php, line 50

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

ArgumentTypeDescription
$disallow_searchboolDefault true

Changelog

VersionDescription
2.0.33Renamed 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

ArgumentTypeDescription
$outputstringrobots.txt contents

Changelog

VersionDescription
2.0.33Renamed 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

ArgumentTypeDescription
$schemasarrayarray of JSON schemas
$post\WP_Postcurrent post

Source: src/Filters/SEOFilter.php, line 470

organic/sitemap_news_trailing_slash_url

Allows to add trailing slash to the sitemap URLs

Arguments

ArgumentTypeDescription
$has_trailing_slashbooldefault false

Changelog

VersionDescription
2.0.33Renamed 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

ArgumentTypeDescription
$initialization_scriptstringdefault init script

Source: src/Options/Pelcro.php, line 133

organic/related_stories_status

Allows overriding related stories status

true - related false - not related

Arguments

ArgumentTypeDescription
$is_relatedbooldefault true
$post_idintPost ID

Source: src/Options/General/PostOptions.php, line 115

organic/acf-post-sponsored-extra-fields

Allows extending ACF Group of Sponsored Fields

Arguments

ArgumentTypeDescription
$group\StoutLogic\AcfBuilder\FieldsBuilderthe group object

Source: src/Options/SponsoredRender.php, line 106

organic/mandatory_fields_options

Allows extending the mandatory fields options

Arguments

ArgumentTypeDescription
$configsarraymandatory fields config

Changelog

VersionDescription
2.0.33Renamed from organic_mandatory_fields_options

Source: src/Options/MandatoryField.php, line 106

organic/syndication/controls_keys

Allows extending the $syndication_controls_keys config

Arguments

ArgumentTypeDescription
$syndication_controls_keysarray

Source: src/Syndication.php, line 104

organic/syndication/controls_types

Allows extending $syndication_controls_types config

Arguments

ArgumentTypeDescription
$syndication_controls_typesarray

Source: src/Syndication.php, line 135

organic/syndication/key_scheme

Allows extending the SQuery->key_scheme config

Arguments

ArgumentTypeDescription
$key_schemearray

Source: src/Syndication/SQuery.php, line 38

organic/syndication/query

Allows modyfing query object in syndication feeds

Arguments

ArgumentTypeDescription
$query\WP_Query

Source: src/Syndication/SQuery.php, line 114

organic/syndication/acf_fields

Allows extending Syndication-related ACF fields

Arguments

ArgumentTypeDescription
$fieldsarraykey -> label array mapping

Source: src/Syndication/AcfFieldsOption.php, line 24

organic/syndication/default_value

Filters publishing defaults mapping

Arguments

ArgumentTypeDescription
$defaultsarrayfeed_key => publish|no_publish array

Source: src/Syndication/AcfFieldsOption.php, line 153

organic/syndication/feed_groups

Allows extending the $feed_groups config

Arguments

ArgumentTypeDescription
self::FEED_GROUPS

Changelog

VersionDescription
2.0.38

Source: src/Syndication/FeedRouter.php, line 122

organic/syndication/feedhelper/query_args

Filters syndication feed query arguments

Arguments

ArgumentTypeDescription
$argsarrayquery arguments
$typestringfeed 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

ArgumentTypeDescription
$allowed_html_tagsarraylist of HTML tags

Source: src/Syndication/Feeds/YahooFeed.php, line 106

organic/syndication/yahoo/show_disclosure

Allows disabling disclosure text in Yahoo feed

Arguments

ArgumentTypeDescription
$should_addbooldefault true

Source: src/Syndication/Feeds/YahooFeed.php, line 120

organic/syndication/yahoo/content

Content filter for Yahoo Feed

Arguments

ArgumentTypeDescription
$contentstringdefault $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

ArgumentTypeDescription
$show_media_contentbooldefault true

Source: src/Syndication/Feeds/YahooFeed.php, line 157

organic/syndication/smartnews/query_args

Filters SmartNews Feed query args

Arguments

ArgumentTypeDescription
$argsarrayquery 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

ArgumentTypeDescription
$feed_typestring

Source: src/Syndication/Feeds/SmartNewsFeed.php, line 227

organic/author/load_more

Returns Author's posts html while clicking Load More

Arguments

ArgumentTypeDescription
$contentstringdefault ''
$author\SWPCore\Authors\Author|null
$postsarraynext portion of posts

Source: src/Authors/AuthorSupport.php, line 376

organic/author/profile_schema

Organic hook filter to modify the ProfilePage schema.

Arguments

ArgumentTypeDescription
$authorSchemaarrayarray data of the current schema.
$authorDataarrayarray of the currently viewed author's custom metas.
$author\WP_Termterm object of the currently viewed author.

Source: src/Authors/AuthorSupport.php, line 584

organic/author_tag/create_from_term

Allows extending Author Term

Arguments

ArgumentTypeDescription
$term\WP_Termauthor term

Source: src/Authors/Author.php, line 34

organic/infinite_scroll/load_more

Returns infinite scroll load_more action content

Arguments

ArgumentTypeDescription
$contentstring
$queryarrayWP_Query args
$exclude_idsarraylist of post ids to exclude
$term_idint|nullTerm ID
$layoutstringdefault 'default'

Source: src/InfiniteScroll.php, line 65

organic/infinite_scroll/items_filter

Filters infinite scroll returned items

Arguments

ArgumentTypeDescription
$itemsarrayreturned items

Source: src/InfiniteScroll.php, line 266

organic/infinite_scroll/items_html

Required filter to enable infinite scroll feature

Renders item html

Arguments

ArgumentTypeDescription
$contentstringdefault ''
$post_dataarraypost_data from SinglePost::getArticleData()

Source: src/InfiniteScroll.php, line 307

Filters product card link

Arguments

ArgumentTypeDescription
$urlstringproduct link

Source: src/ProductCard.php, line 162

organic/pinterest_share_icon

Filters Pinterest icon

Arguments

ArgumentTypeDescription
$share_iconstringhtml of icon <i>..</i>
$class_namestringclass name of base image component. default orgnc-SingleImage

Changelog

VersionDescription
2.0.33renamed 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

ArgumentTypeDescription
$article_htmlstringdefault ''
$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

ArgumentTypeDescription
$customFieldsarrayArray of [$key => $label] items. Default []

Changelog

VersionDescription
2.0.33Renamed 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

ArgumentTypeDescription
$category_path_is_nestedbooldefault false

Changelog

VersionDescription
2.0.36filter 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

ArgumentTypeDescription
$enabledbooldefault true

Changelog

VersionDescription
2.0.33Renamed 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

ArgumentTypeDescription
$localPluginsBasenamesstring[]array of plugin basenames

Source: src/PluginsControl.php, line 23