File: /var/www/html/amberconcept/wp-content/plugins/zeen-engine/inc/ip/ip.php
<?php
function zeen_engine_block() {
$dir = dirname( __FILE__ );
$index_js = 'build/index.js';
$script_asset = require( "$dir/build/index.asset.php" );
wp_register_script(
'zeen-engine-block-ip-editor',
plugins_url( $index_js, __FILE__ ),
$script_asset['dependencies'],
$script_asset['version']
);
wp_set_script_translations( 'zeen-engine-block-ip-editor', 'zeen-engine' );
$editor_css = 'build/index.css';
wp_register_style(
'zeen-engine-block-ip-editor',
plugins_url( $editor_css, __FILE__ ),
array(),
ZEEN_ENGINE_VER
);
register_block_type( 'zeen/block-inline-post', array(
'editor_script' => 'zeen-engine-block-ip-editor',
'editor_style' => 'zeen-engine-block-ip-editor',
'style' => 'zeen-engine-block-ip',
'render_callback' => 'zeen_engine_render_inline',
'attributes' => array(
'pid' => array(
'type' => 'string',
),
'title' => array(
'type' => 'string',
'default' => esc_html__( 'See Also', 'zeen-engine' ),
),
),
) );
}
add_action( 'init', 'zeen_engine_block' );
function zeen_engine_render_inline( $attr = '' ) {
$pid = empty( $attr['pid'] ) ? '' : $attr['pid'];
$title = empty( $attr['title'] ) ? '' : $attr['title'];
if ( ! function_exists( 'zeen_post_inline' ) ) {
return;
}
return zeen_post_inline( array( 'pid' => $pid, 'title' => $title ) );
}