GRAYBYTE WORDPRESS FILE MANAGER3004

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/nioscentre.in/wp-content/plugins/woolentor-addons/includes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/nioscentre.in/wp-content/plugins/woolentor-addons/includes//custom-metabox.php
<?php 
use WooLentor\Traits\Singleton;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

class Woolentor_Free_Custom_Meta_Fields{
    use Singleton;

    /**
     * Constructor
     */
    public function __construct(){

        // Add Field in inventory tab
        add_action( 'woocommerce_product_options_inventory_product_data', [ $this, 'add_extra_field_in_inventory_tab' ] );

        // Custom Product tab
        add_filter( 'woocommerce_product_data_tabs', [ $this, 'product_woolentor_tab' ], 10, 1 );
		add_action( 'woocommerce_product_data_panels', [ $this, 'product_woolentor_data_panel' ], 99 );
		add_action( 'woocommerce_process_product_meta', [ $this, 'save_woolenor_product_meta' ] );

    }

    /**
     * add_extra_field_in_inventory_tab Custom field add in inventory tab
     *
     * @return void
     */
    public function add_extra_field_in_inventory_tab(){

        // Stock progress bar extra field
        echo '<div class="options_group">';
            woocommerce_wp_text_input(
                array(
                    'id'          => 'woolentor_total_stock_quantity',
                    'label'       => __( 'Initial number in stock', 'woolentor' ),
                    'desc_tip'    => 'true',
                    'description' => __( 'Required for stock progress bar', 'woolentor' ),
                    'type'        => 'text',
                )
            );
        echo '</div>';

    }

    // add extra metabox tab to woocommerce
    public function product_woolentor_tab( $tabs ){
        $woolentor_tab = array(
            'label'    => __( 'Product Badge', 'woolentor' ),
            'target'   => 'woolentor_product_data',
            'class'    => '',
            'priority' => 80,
        );
        $tabs['woolentor_product_badge'] = $woolentor_tab;
        return $tabs;
    }

    // add metabox to general tab
    public function product_woolentor_data_panel(){
        echo '<div id="woolentor_product_data" class="panel woocommerce_options_panel hidden">';
            woocommerce_wp_text_input( array(
                'id'          => '_saleflash_text',
                'label'       => __( 'Custom Product Badge', 'woolentor' ),
                'placeholder' => __( 'New', 'woolentor' ),
                'description' => __( 'Enter your preferred Sale badge text. Ex: New / Free etc (Only for Universal layout addon)', 'woolentor' ),
                'desc_tip' => true
            ) );
        echo '</div>';
    }

    // Update data
    public function save_woolenor_product_meta( $post_id ){

        if( wp_verify_nonce( sanitize_key( $_POST['woocommerce_meta_nonce'] ), 'woocommerce_save_data' ) ){

            // Quantity field
            $stock_quantity = !empty( $_POST['woolentor_total_stock_quantity'] ) ? wc_clean( $_POST['woolentor_total_stock_quantity'] ) : '';
            update_post_meta($post_id, 'woolentor_total_stock_quantity', $stock_quantity);

            // Sale Flash
            $saleflash_text = wp_kses_post( stripslashes( $_POST['_saleflash_text'] ) );
            update_post_meta($post_id, '_saleflash_text', $saleflash_text);

        }else{
            delete_post_meta( $post_id, 'woolentor_total_stock_quantity' );
            delete_post_meta( $post_id, '_saleflash_text' );
        }

    }


}
Woolentor_Free_Custom_Meta_Fields::instance();

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
addons
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
admin
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
admin-panel
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
modules
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
traits
--
May 04 2025 08:32:06
giriqfky / giriqfky
0755
api.php
1.906 KB
October 30 2023 09:01:42
giriqfky / giriqfky
0644
archive_product_render.php
9.897 KB
August 27 2023 06:50:10
giriqfky / giriqfky
0644
base.php
17.815 KB
February 18 2025 09:27:26
giriqfky / giriqfky
0644
class.product_video_gallery.php
1.604 KB
November 14 2020 10:00:12
giriqfky / giriqfky
0644
custom-metabox.php
3.277 KB
October 07 2024 13:14:24
giriqfky / giriqfky
0644
helper-function.php
59.755 KB
May 04 2025 09:26:14
giriqfky / giriqfky
0644
manage_wc_template.php
16.691 KB
April 16 2025 09:07:38
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF