Server IP : 172.24.0.40 / Your IP : 216.73.216.10 Web Server : Apache System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64 User : apache ( 48) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/tomas/public_html/wp-content/plugins/ninja-forms/includes/Admin/Metaboxes/ |
Upload File : |
<?php if ( ! defined( 'ABSPATH' ) ) exit; final class NF_Admin_Metaboxes_Calculations extends NF_Abstracts_SubmissionMetabox { public function __construct() { $this->registerReactMetabox(); // Only load if we are editing a post. if( ! isset( $_GET[ 'post' ] ) ) return; parent::__construct(); $this->_title = esc_html__( 'Calculations', 'ninja-forms' ); if( $this->sub && ! $this->sub->get_extra_value( 'calculations' ) ){ remove_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); } } public function render_metabox( $post, $metabox ) { $data = $this->sub->get_extra_values( array( 'calculations' ) ); Ninja_Forms::template( 'admin-metaboxes-calcs.html.php', $data[ 'calculations' ] ); } /** * Register the React metabox for calculations * * @return void */ protected function registerReactMetabox( ): void { add_filter('nf_react_table_extra_value_keys', [$this,'nfAddMetabox']); } /** * Add a metabox constructor to the react.js submissions page * * @param array $metaboxHandlers * @return array */ public function nfAddMetabox(array $metaboxHandlers): array { $metaboxHandlers['calculations']='NinjaForms\Includes\Admin\Metaboxes\CalculationsReact'; return $metaboxHandlers; } }