Let's create one million posts to see the performance of a Wordpress site.
The purpose of this document is to find out what is the underlying data that gets modified in a wordpress database when a post with an image are created.
/* | |
* Adding extra field on New product popup/without popup form | |
*/ | |
add_action( 'dokan_new_product_after_product_tags','new_product_field',10 ); | |
function new_product_field(){ ?> | |
<div class="dokan-form-group"> |
<?php | |
/** | |
* Put this into your functions.php of your child-theme or custom plugin | |
* you can create the role with wp-cli by running `wp shell` and running the command: | |
* add_role('merchant','Merchant',array('read' => true, 'delete_posts' => false) ); | |
*/ | |
/** | |
* Step #1: create the field used to store the new sale_price for product_variation and for products | |
*/ |
<?php | |
/** | |
* Update Post Title from an ACF field value on post save. | |
* | |
* Triggers on save, edit or update of published posts. | |
* Works in "Quick Edit", but not bulk edit. | |
*/ | |
function sync_acf_post_title($post_id, $post, $update) { | |
$acf_title = get_field('my_acf_field_name', $post_id); // NOTE: enter the name of the ACF field here |
<?php | |
$sku = 'ITEM001'; | |
$qty = 1; | |
// Get product_id from SKU — returns null if not found | |
$product_id = wc_get_product_id_by_sku( $sku ); | |
// Process if product found | |
if ( $product_id != null ) { |
<?php | |
/* | |
Plugin Name: Add Gift Card as Custom Product Type | |
Description: A simple demo plugin on how to add Gift Card as your custom product type | |
Author: Bhavik Kiri | |
Version: 1.0 | |
*/ | |
add_action( 'plugins_loaded', 'wcpt_register_gift_card_type' ); |
<?php | |
/** | |
* | |
* You can find the complete tutorial for this here: | |
* https://pluginrepublic.com/woocommerce-custom-fields | |
* | |
* Alternatively, check out the plugin | |
* https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/ | |
* |
<?php | |
/* | |
Plugin Name: Contact Form 7 to External DB | |
Plugin URI: | |
Description: This plugin uses the wpcf7_before_send_mail hook to post a specific form to an external database. Upon use the details for your external database will need to be entered. Private use only. | |
Author: | |
Version: 0.2 | |
Author URI: | |
*/ |
<?php | |
add_filter( 'gform_column_input_2_15_1', 'set_column', 10, 5 ); | |
function set_column( $input_info, $field, $column, $value, $form_id ) { | |
$request = wp_remote_get( 'https://pippinsplugins.com/edd-api/products' ); | |
if( is_wp_error( $request ) ) { | |
return false; // Bail early | |
} | |
$body = wp_remote_retrieve_body( $request ); |
<?php | |
add_action( 'woocommerce_before_single_product', 'bbloomer_show_video_not_image' ); | |
function bbloomer_show_video_not_image() { | |
// Do this for product ID = 282 only | |
if ( is_single( '282' ) ) { | |
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); | |
remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); |