add_filter('wp_all_import_set_post_terms', 'wpai_wp_all_import_set_post_terms', 10, 4);
function wpai_wp_all_import_set_post_terms($assign_terms, $tx_name, $pid, $import_id) {
if ($tx_name == 'product_cat'){
$post = get_post($pid);
if ($post->post_type == 'product_variation') {
$parentID = $post->post_parent;
$term_ids = wp_get_object_terms($parentID, $tx_name, array( 'fields' => 'ids' ));
if (!empty($assign_terms)) {| <?php | |
| // check if hashed password is SHA1 and update as necessary, see function comments | |
| add_filter( 'check_password', 'check_sha1_password', 10, 4 ); | |
| /** | |
| * Check if a user has a SHA1 password hash, allows login if password hashes match, then updates password hash to wp format | |
| * | |
| * Hooks into check_password filter, mostly copied from md5 upgrade function with pluggable.php/wp_check_password | |
| * | |
| * @param string $check |
| <?php | |
| /* | |
| ################### READ ME ################################# | |
| You'll pass the URL to your feed/file to this function inside the "Download from URL" option when creating an import. Examples: | |
| 1. [custom_file_download("ftp://username:password@hostname.com/full/path/to/file.csv", "csv")] | |
| 2. [custom_file_download("http://example.com/full/path/to/file.csv", "csv")] | |
| You must add the code for the function inside your themes functions.php file, or in a plugin like Code Snippets. |
| NOTICE: Booting Trusted Firmware | |
| NOTICE: BL1: v1.3(debug):armada-17.06.2:297d68f | |
| NOTICE: BL1: Built : 11:01:44, Jan 9 2NOTICE: BL2: v1.3(debug):armada-17.06.2:297d68f | |
| NOTICE: BL2: Built : 11:01:47, Jan 9 2018NOTICE: BL31: v1.3(debug):armada-17.06.2:297d68f | |
| NOTICE: BL31: | |
| U-Boot 2017.03-armada-17.06.3-ga33ecb8-dirty (Jan 09 2018 - 10:56:45 -0200) | |
| Model: Marvell Armada 3720 Community Board ESPRESSOBin | |
| CPU @ 1000 [MHz] |
| // proof-of-concept to extract all WordPress Gutenberg's blocks as array | |
| // author: Frank Goossens (Futta) | |
| // source: https://blog.futtta.be/2018/01/25/how-to-extract-blocks-from-gutenberg/ | |
| add_action('the_content','gutenprint',10,1); | |
| function gutenprint($html) { | |
| // check if we need to and can load the Gutenberg PEG parser | |
| if ( !class_exists("Gutenberg_PEG_Parser") && file_exists(WP_PLUGIN_DIR."/gutenberg/lib/load.php") ) { | |
| include_once(WP_PLUGIN_DIR."/gutenberg/lib/load.php"); | |
| } |
- New Items Import -
This is primarily used to create and manage products. It keeps internal track of the products that it imports, which means that it can later update/create/delete products as they're changed/added/removed in your import file. It's also the only import type that can add/remove variations for variable products.
One limitation of new items imports is that cannot detect/update products that it didn't previously create.
- New Items Import -
This is primarily used to create and manage products. It keeps internal track of the products that it imports, which means that it can later update/create/delete products as they're changed/added/removed in your import file. It's also the only import type that can add/remove variations for variable products.
One limitation of new items imports is that cannot detect/update products that it didn't previously create. If you need to use a "New Items" import with a file that contains existing products, you can use WP All Import's API to prevent duplicates from being imported: https://www.wpallimport.com/documentation/developers/code-snippets/#do-not-create-products-with-duplicate-sku.
| <?php | |
| error_reporting(E_ALL); | |
| $opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']); | |
| if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) { | |
| $self = basename(__FILE__); | |
| echo <<<EOF | |
| Usage: | |
| php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<file>]] |
| # In your Jenkins job configuration, select "Add build step > Execute shell", and paste this script contents. | |
| # Replace `______your-plugin-name______`, `______your-wp-username______` and `______your-wp-password______` as needed. | |
| # main config | |
| WP_ORG_USER="______your-wp-username______" # your WordPress.org username | |
| WP_ORG_PASS="______your-wp-password______" # your WordPress.org password | |
| PLUGINSLUG="______your-plugin-name______" | |
| CURRENTDIR=`pwd` | |
| MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin |
| <?php | |
| global $ld_recalc; | |
| global $geolocate_api_key; | |
| $geolocate_api_key = "YOUR_GOOGLE_GEOLOCATE_API_KEY"; | |
| $ld_recalc = array( | |
| 'posts_per_run' => 16, | |
| 'post_types' => array( 'distributor' ), |