This file contains hidden or 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: ACF 5.8 Test | |
*/ | |
class ACF_Test_Block { | |
public $_name = 'test-acf-block'; | |
public function __construct() { | |
add_action( 'acf/init', [ $this, 'register_block' ] ); |
This file contains hidden or 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( 'gform_countries', 'gform_use_wc_countries' ); | |
function gform_use_wc_countries() { | |
if( class_exists( 'WC') ) { | |
return WC()->countries->countries; | |
} | |
} |
This file contains hidden or 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
class MyTheme { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { | |
add_filter( 'gform_ajax_spinner_url', array($this, 'replace_gform_spinner'), 10, 2 ); | |
} |
This file contains hidden or 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 | |
class Sample { | |
public function __construct() { | |
$this->hooks(); | |
} | |
private function hooks() { | |
add_filter( 'rest_post_collection_params', [ $this, 'increase_maximum_rest_posts' ] ); | |
} | |
private function increase_maximum_rest_posts( $params ) { |
This file contains hidden or 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
## | |
# This assumes the following folder structure | |
# Local environment: | |
# ./app/ | |
# ./app/www/ | |
# ./_db_dumps/ | |
# | |
# Production/staging environment: | |
# ./wordpress/current/ | |
# ./_db_dumps/ |
This file contains hidden or 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 | |
/** | |
* Accept any license key for free downloads. | |
* This assumes that license creation is enabled for the free download | |
*/ | |
add_filter( 'edd_sl_id_license_match', function ( $license_match, $download_id ) { | |
$download = edd_get_download( $download_id ); | |
if ( method_exists( $download, 'is_free' ) ) { |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript"> | |
function addToCart() { | |
var data = [ | |
{ | |
product_id: 218, | |
customize_hash: 'erg5eyu2r245710', | |
quantity: 48 | |
} |
This file contains hidden or 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('edd_sl_api_request_verify_ssl', '__return_false'); | |
add_filter('https_ssl_verify', '__return_false'); | |
add_filter('https_local_ssl_verify', '__return_false'); | |
add_filter('http_request_host_is_external', '__return_true'); |
This file contains hidden or 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 | |
class EDD_Updates_Without_Licenses { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { | |
add_filter( 'edd_sl_id_license_match', array( $this, 'check_free_license' ), 10, 4 ); |
This file contains hidden or 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 ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
class Sample_Extend_Endpoint extends WC_REST_Controller { | |
protected $namespace = 'wc/v3'; |