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
//Colorado fee | |
/** | |
* Add a .27 surcharge to orders shipping to Colorado | |
* https://www.thathandsomebeardedguy.com/woocommerce-colorado-retail-delivery-fee/ | |
*/ | |
add_action('woocommerce_cart_calculate_fees', 'handsome_bearded_guy_custom_surcharge'); | |
function handsome_bearded_guy_custom_surcharge() { | |
global $woocommerce; |
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
const { registerBlockType } = wp.blocks; | |
registerBlockType( 'my-plugin/hello-world', { | |
title: 'Hello World', | |
icon: 'smiley', | |
category: 'common', | |
edit: () => { | |
return ( | |
<p>Hello World!</p> | |
); |
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 | |
/* | |
Plugin Name: Meta Box Example | |
Description: Example demonstrating how to add Meta Boxes. | |
Plugin URI: https://plugin-planet.com/ | |
Author: Jeff Starr | |
Version: 1.0 | |
*/ | |
// register meta box |
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 | |
global $wpdb; | |
$tbl = $wpdb->prefix . 'posts'; | |
$post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", 1 ) ); // posts can reference in the phpstorm | |
$prefix_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $tbl WHERE ID = %d", 1 ) ); // phpstorm: unable to resolve ID | |
$prepare_query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", 1 ); | |
$prepare_result = $wpdb->get_col( $prepare_query ); // 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
<?php | |
defined( 'ABSPATH' ) || exit; | |
global $vap, $vap_sync; | |
$lastsync_option = $vap_sync->vap_get_lastsync(); | |
$ls_timestamp = $lastsync_option['timestamp']; | |
$ls_category = $lastsync_option['category']; | |
$ls_page = $lastsync_option['page']; |
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 | |
global $vap, $vap_settings; | |
if( isset( $_REQUEST['vap_setting_save'] ) && isset( $_REQUEST['vap_setting'] ) && $_REQUEST['vap_setting'] != '' ) { | |
do_action( 'vap_save_settings', $_POST ); | |
} | |
echo '<div class="wrap vap_content">'; | |
if( isset( $_SESSION['vap_cfg_msg_status'] ) && $_SESSION['vap_cfg_msg_status'] ) { |
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 | |
if( !class_exists ( 'VAP_Settings' ) ) { | |
class VAP_Settings { | |
function __construct(){ | |
add_action( "vap_save_settings", array( $this, "vap_save_settings_func" ), 10 , 1 ); | |
add_action( 'wp_ajax_vap_setting_dellastsync', array( $this, 'vap_setting_dellastsync' ) ); |
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 | |
/* | |
Plugin Name: VIN Articles Post | |
Plugin URI: https://www.vinpractice.com/ | |
Description: Sync / import CDP articles from VIN Api | |
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
var vapSyncCategories = []; | |
var vapAllSuccess = true; | |
var vapRunning = false; | |
function vapGetCategoryArticles(categoryIndex, pageIndex) { | |
var post_data = { | |
action: 'vap_sync_start', | |
on_sync: true, | |
category_id: vapSyncCategories[categoryIndex].id, | |
category_wpid: vapSyncCategories[categoryIndex].wpid, |
NewerOlder