A Pen by hosein shurabi on CodePen.
This file contains 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( 'vc_grid_item_shortcodes', 'my_module_add_grid_shortcodes' ); | |
function my_module_add_grid_shortcodes( $shortcodes ) { | |
$shortcodes['vc_avatarino'] = array( | |
'name' => __( 'Avatar', 'mrcatdev' ), | |
'base' => 'vc_avatarino', | |
'category' => __( 'Content', 'mrcatdev' ), | |
'description' => __( 'Avatar', 'mrcatdev' ), | |
'post_type' => Vc_Grid_Item_Editor::postType(), | |
); |
This file contains 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
create temporary table tmpTable (meta_id bigint); | |
Insert into tmpTable (meta_id) | |
select meta_id | |
from wp_postmeta pt | |
where exists | |
( | |
select * | |
from wp_postmeta pt2 |
This file contains 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
# Delete all Woocomerce Order (CLI v2.3.0) | |
wp post delete $(wp post list --field=ID --post_type="shop_order") --force | |
# Import Data with skip authors | |
wp import orders.xml --authors=skip | |
# Export all post type with unlimite size | |
wp export --post_type=any --max_file_size=-1 |
This file contains 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
#WP_USERS | |
INSERT INTO `wp_users`(ID,user_login,user_pass,user_nicename,user_email,user_url,user_registered,user_activation_key,user_status,display_name) VALUES | |
(4,'aaa','$P$BmPs7v0824pjqq1bY7WZsKtl0qjw0x0','aa','daphne@aa.com','''','2019-07-01 03:45:13','''',0,'The aa') # yourdata | |
ON DUPLICATE KEY UPDATE | |
user_pass=VALUES(user_pass), | |
user_nicename=VALUES(user_nicename), | |
user_nicename=VALUES(user_nicename), | |
user_email=VALUES(user_email), |
This file contains 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
INSERT INTO `wp_postmeta`(meta_id,post_id,meta_key,meta_value) VALUES | |
(24947,3352,'_stock',2),(24947,3352,'_stock',21) | |
ON DUPLICATE KEY UPDATE meta_value=VALUES(meta_value) |
This file contains 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 | |
// This code should be added to the functions.php file of the child theme | |
// Add WooCommerce Brands logo with description to Additional Information product tab | |
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
global $product; | |
$tabs['additional_information']['callback'] = 'add_brand_to_info'; // this is the function name which is included below | |
return $tabs; | |
} |
This file contains 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 content of Advance custom fields to description tab. | |
function add_acf_description_tab_content($data) { | |
woocommerce_product_description_tab(); | |
echo '<hr>'; | |
echo '<h3>Board Attributes</h3>'; | |
$ba = get_field('board_attributes'); // ba = board_attribute => get field board_attribute from acf | |
$ba_items = [ | |
// ['Attribute','value','image_url'] | |
['Terrian',$ba['terrain'],$ba['terrain_thumbnail']], |
A Pen by hosein shurabi on CodePen.
A Pen by hosein shurabi on CodePen.
NewerOlder