Server IP : 3.128.248.115 / Your IP : 3.15.12.95 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ip-172-31-33-233 5.15.0-1037-aws #41~20.04.1-Ubuntu SMP Mon May 22 18:18:00 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.28 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/housing-portal.org/wp-includes/blocks/ |
Upload File : |
<?php /** * Server-side rendering of the `core/post-content` block. * * @package WordPress */ /** * Renders the `core/post-content` block on the server. * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * @return string Returns the filtered post content of the current post. */ function render_block_core_post_content( $attributes, $content, $block ) { static $seen_ids = array(); if ( ! isset( $block->context['postId'] ) ) { return ''; } $post_id = $block->context['postId']; if ( isset( $seen_ids[ $post_id ] ) ) { // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent // is set in `wp_debug_mode()`. $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY; return $is_debug ? // translators: Visible only in the front end, this warning takes the place of a faulty block. __( '[block rendering halted]' ) : ''; } $seen_ids[ $post_id ] = true; // When inside the main loop, we want to use queried object // so that `the_preview` for the current post can apply. // We force this behavior by omitting the third argument (post ID) from the `get_the_content`. $content = get_the_content(); // Check for nextpage to display page links for paginated posts. if ( has_block( 'core/nextpage' ) ) { $content .= wp_link_pages( array( 'echo' => 0 ) ); } /** This filter is documented in wp-includes/post-template.php */ $content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) ); unset( $seen_ids[ $post_id ] ); if ( empty( $content ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) ); return ( '<div ' . $wrapper_attributes . '>' . $content . '</div>' ); } /** * Registers the `core/post-content` block on the server. */ function register_block_core_post_content() { register_block_type_from_metadata( __DIR__ . '/post-content', array( 'render_callback' => 'render_block_core_post_content', ) ); } add_action( 'init', 'register_block_core_post_content' );