| Server IP : 65.109.86.83 / Your IP : 216.73.217.84 Web Server : nginx/1.14.1 System : Linux libra 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 20:24:04 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.31 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/plugins/404page/ |
Upload File : |
<?php
/**
* The 404page Plugin Block
*
* @since 11.4.0
*
**/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
add_action( 'init', function() {
if ( function_exists('register_block_type_from_metadata' ) ) {
register_block_type_from_metadata( __DIR__, [
'render_callback' => function( $atts ) {
$alignmentClass = ( $atts['alignment'] != null ) ? 'has-text-align-' . $atts['alignment'] : '';
return '<p ' . get_block_wrapper_attributes( [ 'class' => $alignmentClass ] ) . '>' . pp_404_get_the_url( $atts[ 'urltype' ] ) . '</p>';
}
] );
}
} );
// Moved from init to enqueue_block_editor_assets in 11.4.1
add_action( 'enqueue_block_editor_assets', function() {
wp_enqueue_script(
'404page-block',
pp_404page()->get_asset_url( 'js', 'block.js' ),
[ 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor' ],
pp_404page()->get_plugin_version()
);
} );