• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress develop tests

WordPress develop tests

WordPress develop tests a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Tests_Actions::test_doing_filter() –

You appear to be a bot. Output may be restricted

Description

Usage

Tests_Actions::test_doing_filter();

Parameters

Returns

void

Source

File name: wordpress-develop-tests/phpunit/tests/actions.php


Lines:

1 to 16 of 16
  public function test_doing_filter() {
    global $wp_current_filter;
    $wp_current_filter = array(); // Set to an empty array first.

    $this->assertFalse( doing_filter() );            // No filter is passed in, and no filter is being processed.
    $this->assertFalse( doing_filter( 'testing' ) ); // Filter is passed in but not being processed.

    $wp_current_filter[] = 'testing';

    $this->assertTrue( doing_filter() );                    // No action is passed in, and a filter is being processed.
    $this->assertTrue( doing_filter( 'testing' ) );         // Filter is passed in and is being processed.
    $this->assertFalse( doing_filter( 'something_else' ) ); // Filter is passed in but not being processed.

    $wp_current_filter = array();
  }
 

 View on GitHub

Published: 26th November 2019 | Last updated: 20th March 2022

Primary Sidebar

Information

Function name: Tests_Actions::test_doing_filter
Class ref: Tests_Actions
Plugin ref: WordPress develop tests
Version: 5.9.3
Sourcefile: phpunit/tests/actions.php
File ref: phpunit/tests/actions.php
Deprecated?: No
API Letters: A,D,F,T

Footer

WordPress develop tests
WordPress develop tests
WordPress develop tests a2z
WordPress 6.4.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  develop.wp-a2z.org
© Copyright WordPress develop tests 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites