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
# <!=Copyright (C) 2023 XTemos | |
# This file is distributed under the GNU General Public License version 3.0.=!> | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: Woodmart 7.3.1\n" | |
"Report-Msgid-Bugs-To: http://xtemos.com\n" | |
"POT-Creation-Date: 2023-10-04 12:14:37+00:00\n" | |
"MIME-Version: 1.0\n" | |
"Content-Type: text/plain; charset=UTF-8\n" | |
"Content-Transfer-Encoding: 8bit\n" |
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
$products = [ | |
['name' => 'Shirt', 'price' => 30, 'sales' => 100], | |
['name' => 'Jeans', 'price' => 50, 'sales' => 80], | |
['name' => 'Hat', 'price' => 20, 'sales' => 120], | |
['name' => 'Shoes', 'price' => 50, 'sales' => 200], | |
['name' => 'Socks', 'price' => 10, 'sales' => 50], | |
]; | |
$posts = [ | |
['title' => 'Learn PHP', 'date' => '2023-05-01'], |
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
if (!class_exists('WP_List_Table')) { | |
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; | |
} | |
class Address_List_Table extends WP_List_Table { | |
public function __construct() { | |
parent::__construct([ | |
'singular' => 'address', | |
'plural' => 'addresses', |
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
use PhpOffice\PhpSpreadsheet\Spreadsheet; | |
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | |
include get_template_directory() . '/vendor/autoload.php'; | |
add_action('wp_head', function() { | |
// Create a new spreadsheet | |
$spreadsheet = new Spreadsheet(); | |
$sheet = $spreadsheet->getActiveSheet(); |
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
/** | |
* Fetches the geolocation information for the client's IP address. | |
* Uses WordPress HTTP API if in a WordPress environment, otherwise uses cURL. | |
* Try to test in real server no in Localhost | |
* @see Adjust in 'wp_head' hook to quickly test | |
* @see add_action( 'wp_head', 'prefix_fetch_geolocation' ); | |
* @return void | |
*/ | |
function prefix_fetch_geolocation( $json_decode = null ) { |
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 ip_info($ip = NULL, $purpose = "location", $deep_detect = TRUE) { | |
$output = NULL; | |
if (filter_var($ip, FILTER_VALIDATE_IP) === FALSE) { | |
$ip = $_SERVER["REMOTE_ADDR"]; | |
if ($deep_detect) { | |
if (filter_var(@$_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
if (filter_var(@$_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP)) | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} |
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
/** | |
* Add custom package fields to product inventory options. | |
*/ | |
function sdev_add_custom_package_fields() { | |
woocommerce_wp_checkbox( array( | |
'id' => '_package_product', | |
'label' => 'Is it a package type product?', | |
'description' => 'Check this box if it is a package type product', |
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
//Take list of data from browser as an object in js or as an array in php | |
//Now copy object from browser and paste into your file | |
const authorList = document.querySelectorAll('#lct-widget-product_author li a'); | |
const authorNames = Array.from(authorList).map(author => author.textContent.trim()); | |
console.log(authorNames); |
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
/** | |
* Autoloader Main function | |
* | |
* @param [type] $class | |
* @return void | |
*/ | |
function xpovio_core_autoloader( $class ) { | |
$namespace = 'XpovioCore'; // Core namespace \ It could be ParentProject/SubProject; | |
$base_dir = __DIR__ . '/includes/'; |
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
$(".chosen-select").chosen({ | |
no_results_text: "Oops, nothing found!" | |
}) | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script src="https://cdn.rawgit.com/harvesthq/chosen/gh-pages/chosen.jquery.min.js"></script> | |
<link href="https://cdn.rawgit.com/harvesthq/chosen/gh-pages/chosen.min.css" rel="stylesheet"/> | |
<form action="http://httpbin.org/post" method="post"> | |
<select data-placeholder="Begin typing a name to filter..." multiple class="chosen-select" name="test"> | |
<option value=""></option> |
NewerOlder