• 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 / Test_WP_Customize_Partial::test_render_return_callback() – Test WP_Customize_Partial::render() with a return_callback that echos.

You appear to be a bot. Output may be restricted

Description

Test WP_Customize_Partial::render() with a return_callback that echos.

Usage

Test_WP_Customize_Partial::test_render_return_callback();

Parameters

Returns

void

Source

File name: wordpress-develop-tests/phpunit/tests/customize/partial.php


Lines:

1 to 18 of 18
  public function test_render_return_callback() {
    $partial                                       = new WP_Customize_Partial(
      $this->selective_refresh,
      'foo',
      array(
        'render_callback' => array( $this, 'render_return' ),
      )
    );
    $count_filter_customize_partial_render         = $this->count_filter_customize_partial_render;
    $count_filter_customize_partial_render_with_id = $this->count_filter_customize_partial_render_with_id;
    add_filter( 'customize_partial_render', array( $this, 'filter_customize_partial_render' ), 10, 3 );
    add_filter( "customize_partial_render_{$partial->id}", array( $this, 'filter_customize_partial_render_with_id' ), 10, 3 );
    $rendered = $partial->render();
    $this->assertSame( 'bar', $rendered );
    $this->assertSame( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );
    $this->assertSame( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );
  }
 

 View on GitHub

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

Primary Sidebar

Information

Function name: Test_WP_Customize_Partial::test_render_return_callback
Class ref: Test_WP_Customize_Partial
Plugin ref: WordPress develop tests
Version: 5.9.3
Sourcefile: phpunit/tests/customize/partial.php
File ref: phpunit/tests/customize/partial.php
Deprecated?: No
API Letters: C,P,T,W

Footer

WordPress develop tests
WordPress develop tests
WordPress develop tests a2z
WordPress 6.3.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