HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/slfopp7cb1df/public_html/home/wp-content/plugins/easy-pricing-tables/includes/block.js
( function( blocks, editor, element ) {

	var createElement  = element.createElement
	var BlockControls = editor.BlockControls
	var SelectControl = wp.components.SelectControl
	var Toolbar = wp.components.Toolbar
	var tables = dh_ptp_gutenblock_script_data.tables

	if ( dh_ptp_gutenblock_script_data.existing ){
		blocks.registerBlockType( 'easy-pricing-tables/gutenblock', {
			title: 'Pricing Tables (Legacy)',
			icon: 'editor-table',
			category: 'widgets',
			keywords: ['pricing', 'table', 'tables' ],
			edit: function( props ) {
				return [
					createElement(
						BlockControls,
						{ 
							key: 'controls'
						},		
						createElement(
							SelectControl,
							{	
								className: 'dh-ptp-gutenblock-select',
								value: props.attributes.post_id,
								options: tables,
								onChange: function( newValue ){ props.setAttributes({ post_id: newValue }) }
							}
						),
						props.attributes.post_id == 0 ? '' : 
						createElement(
							'a',
							{	
								href: dh_ptp_gutenblock_script_data.editurl + '?post=' + props.attributes.post_id + '&action=edit',
								target: '_blank',
								className: 'dh-ptp-gutenblock-link'
							},
							'Edit'
						),
						createElement(
							'a',
							{	
								href: dh_ptp_gutenblock_script_data.newurl + '?post_type=easy-pricing-table',
								target: '_blank',
								className: 'dh-ptp-gutenblock-link'
							},
							'New'
						)
					),

					createElement( wp.components.ServerSideRender, {
						block: 'easy-pricing-tables/gutenblock',
						attributes:  props.attributes,
					})
				]
			},

			save: function( props ) {
				return null
			},
		} )
	} else {
		return null;
	}
}(
	window.wp.blocks,
	window.wp.editor,
	window.wp.element
))