This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Allow changing of the canonical URL. | |
| * | |
| * @param | |
| string $canonical The canonical URL. | |
| */ | |
| add_filter( 'rank_math/frontend/canonical', function( $canonical ) { | |
| return str_replace( | |
| 'https://blog.example.com', | |
| 'https://example.com/blog', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # In cpanel when deploying an nodejs app | |
| # we need to first go to terminal and activate virtual env | |
| source /home/veriffid/nodevenv/paidup.net/18/bin/activate && cd /home/veriffid/paidup.net | |
| # Then find node version using | |
| # then install packages | |
| # First, check what npm is available | |
| which -a npm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static function init() { | |
| add_action( 'init', array( __CLASS__, 'trtrtr') ); | |
| add_action( 'weweweaaewa', array( __CLASS__, 'rererere') ); | |
| add_filter( 'cron_schedules', array( __CLASS__, 'ac_custom_cron_schedules') ); | |
| } | |
| public static function ac_custom_cron_schedules( $schedules ) { | |
| $schedules['every_minute'] = array( | |
| 'interval' => 60, // 60 সেকেন্ড = 1 মিনিট |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function write_log( ...$data ) { | |
| if ( true === WP_DEBUG ) { | |
| $backtrace = debug_backtrace(); | |
| $backtrace = array_shift( $backtrace ); | |
| $output['backtrace'] = $backtrace['file'] . ':' . $backtrace['line']; | |
| foreach ( $data as $key => $value ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const logger = new Proxy((...message) => { | |
| console.log(...message); | |
| }, { | |
| apply(target, thisArg, argumentsList) { | |
| const stack = new Error().stack.split('\n').slice(2, 4).join('\n'); | |
| console.log('Logger called with arguments:', argumentsList); | |
| console.log('Stack Trace:\n', stack); | |
| return target(...argumentsList); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define('DSK_VERSION', '1.1.4'); | |
| $cache_buster = DSK_VERSION; | |
| if ( defined( 'WP_DEBUG' ) && WP_DEBUG) { | |
| $cache_buster = date("YmdHi", filemtime( get_stylesheet_directory() . '/css/main.css')); | |
| } | |
| function my_scripts_and_styles(){ | |
| global $cache_buster; | |
| wp_enqueue_style( 'main-style', get_stylesheet_directory_uri() . '/css/main.css', array( 'woodmart-style' ), $cache_buster, 'all' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function qw( $data ) { | |
| if ( true === WP_DEBUG ) { | |
| $backtrace = debug_backtrace(); | |
| $backtrace = array_shift( $backtrace ); | |
| $output['backtrace'] = $backtrace['file'] . ':' . $backtrace['line']; | |
| $output['data'] = $data; | |
| error_log( print_r( $output, true ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('woocommerce_states', 'stylish_woocommerce_states'); | |
| function stylish_woocommerce_states($states) { | |
| $states['BD'] = array( | |
| 'BD-05' => 'Bagerhat - বাগেরহাট', | |
| 'BD-01' => 'Bandarban - বান্দরবান', | |
| 'BD-02' => 'Barguna - বরগুনা', | |
| 'BD-06' => 'Barishal - বরিশাল', | |
| 'BD-07' => 'Bhola - ভোলা', | |
| 'BD-03' => 'Bogura - বগুড়া', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #ionCube Extension installer for PHP 8.1 LiteSpeed Servers | |
| wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz | |
| tar -zxvf ioncube_loaders_lin_x86-64.tar.gz | |
| cp ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20200930/ | |
| rm ioncube_loaders_lin_x86-64.tar.gz | |
| rm -rf ioncube | |
| #sudo echo "extension=ioncube_loader_lin_8.1.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/01-ioncube.ini | |
| sudo echo "zend_extension=ioncube_loader_lin_8.1.so" >> /etc/php/8.1/cli/php.ini | |
| sudo systemctl restart lsws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Make postal code optional | |
| add_filter( 'woocommerce_default_address_fields', 'customize_extra_fields', 1000, 1 ); | |
| function customize_extra_fields( $address_fields ) { | |
| $address_fields['postcode']['required'] = false; //Postcode | |
| return $address_fields; | |
| } | |
| // Hide checkout fields | |
| function reorder_billing_fields($fields) { | |
| $billing_order = [ |
NewerOlder