Skip to main content

Wordpress API Filter/Hook Reference

Actions

organic/syndication/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
3.0.19renamed from "organic/actions/update_post_feed_status_$type"
2.0.33renamed from "organic_update_post_feed_status_$type"

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

organic/actions/update_post_feed_status_{$type}

Arguments

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

VersionDescription
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

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 586

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/allow_create_taxonomies_on_post_edit

List of taxonomies which are not allowed to be created directly from post-edit page.

Arguments

ArgumentTypeDescription
['internal_tag', 'category']

Source: src/Filters/TaxonomyFilter.php, line 202

organic/block_args/{$block_type}

Arguments

ArgumentTypeDescription
$args

Source: src/Filters/BlockFilter.php, line 129

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 51

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 80

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

ArgumentTypeDescription
$schemasarrayarray of JSON schemas
$post\WP_Postcurrent post

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

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 576

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/query

Allows modyfing query object in syndication feeds

Arguments

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

ArgumentTypeDescription
self::$feeds

Source: src/Syndication/Syndication.php, line 45

organic/syndication/default_value

Arguments

ArgumentTypeDescription
[]

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

organic/syndication/feed_status_default/{$name}

Filters feed status default value

Arguments

ArgumentTypeDescription
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

ArgumentTypeDescription
$default_valuemixedValue of the option

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

organic/syndication/options/sub_fields

Filter hook for option page sub fields.

Arguments

ArgumentTypeDescription
$sub_fieldsarraylist of current sub-fields.
$namestringname of the syndication.

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

organic/syndication/options/sub_fields/{$name}

Arguments

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

ArgumentTypeDescription
['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

ArgumentTypeDescription
true

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

organic/syndication/yahoo/content

Content filter for Yahoo Feed

Arguments

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

ArgumentTypeDescription
true

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

organic/syndication/feedhelper/query_args

Arguments

ArgumentTypeDescription
$argsarrayquery arguments
static::get_feed_type()

Source: src/Syndication/Feeds/AbstractFeed.php, line 43

organic/syndication/query_args/{$feed_name}

Filters syndication feed query arguments

Arguments

ArgumentTypeDescription
$argsarrayquery arguments

Source: src/Syndication/Feeds/AbstractFeed.php, line 53

organic/syndication/smartnews/query_args

Arguments

ArgumentTypeDescription
$default_args

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

organic/syndication/smartnews_logo_url

Arguments

ArgumentTypeDescription
self::get_feed_type()
$logo_urlstring

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

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 66

organic/infinite_scroll/items_filter

Filters infinite scroll returned items

Arguments

ArgumentTypeDescription
$itemsarrayreturned items

Source: src/InfiniteScroll.php, line 267

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 308

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/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 73

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 291

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 409

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