First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
<?php | |
//Display Fields | |
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 ); | |
//JS to add fields for new variations | |
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
//Save variation fields | |
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 ); | |
/** |
<?php | |
/** | |
* Plugin Name: WooCommerce Settings Tab Demo | |
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a | |
* Description: A plugin demonstrating how to add a WooCommerce settings tab. | |
* Author: Patrick Rauland | |
* Author URI: http://speakinginbytes.com/ | |
* Version: 1.0 | |
* | |
* This program is free software: you can redistribute it and/or modify |
<?php | |
$file = '/path/to/file.png'; | |
$filename = basename($file); | |
$upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
if (!$upload_file['error']) { | |
$wp_filetype = wp_check_filetype($filename, null ); | |
$attachment = array( | |
'post_mime_type' => $wp_filetype['type'], | |
'post_parent' => $parent_post_id, |
Go to this directory | |
For Mac Users | |
/usr/local/pear/share/pear/PHP/CodeSniffer/Standards | |
For Linux Users | |
/usr/share/php/PHP/CodeSniffer/Standards/ | |
then |
<?php | |
if ( ! function_exists( 'vk_get_tax_cost_by_country' ) ) { | |
/** | |
* Get tax cost by country code. | |
* | |
* @param string $country_code Code of country. | |
* @param int $total Cart total. | |
* | |
* @return int Cost of tax. |
<?php | |
/** | |
* File contains all hooks related to Submission post type. | |
* | |
* Required in customizer.php. | |
* | |
* @package vk-research | |
*/ | |
/** |
<?php | |
/* | |
* Plugin Name: Paulund WP List Table Example | |
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area | |
* Plugin URI: http://www.paulund.co.uk | |
* Author: Paul Underwood | |
* Author URI: http://www.paulund.co.uk | |
* Version: 1.0 | |
* License: GPL2 | |
*/ |
<?php | |
/** | |
* Plugin Name: All Options Limit for WordPress | |
* Description: Provides warnings and notifications for wp_options exceeding limits. | |
* Author: Vishal | |
* License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
*/ | |
/** |
// Update PHPcs | |
sudo pear upgrade-all and sudo pear install PHP_CodeSniffer | |
// Check version of PHPcs | |
phpcs --version | |
// Go to Where coding standards available | |
/usr/local/pear/share/pear/PHP/CodeSniffer/Standards/WordPress-Coding-Standards |