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 | |
// Freemius PHP SDK - https://github.com/Freemius/freemius-php-sdk | |
require_once './php-sdk-master/freemius/Freemius.php'; | |
define( 'FS__API_SCOPE', 'developer' ); | |
define( 'FS__API_DEV_ID', 1234 ); | |
define( 'FS__API_PUBLIC_KEY', 'pk_YOUR_PUBLIC_KEY' ); | |
define( 'FS__API_SECRET_KEY', 'sk_YOUR_SECRET_KEY' ); | |
// Init SDK. |
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
/* Produces a dump on the state of WordPress when a not found error occurs */ | |
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */ | |
ini_set( 'error_reporting', -1 ); | |
ini_set( 'display_errors', 'On' ); | |
echo '<pre>'; | |
add_action( 'parse_request', 'debug_404_rewrite_dump' ); | |
function debug_404_rewrite_dump( &$wp ) { |
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( | |
'blocksy:woocommerce:product-card:thumbnail:ratio', | |
function ($ratio) { | |
// Please change this | |
$my_page_id = 123; | |
if (is_page($my_page_id)) { | |
// Your custom ratio |
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( | |
'blocksy:general:blocks:query:args', | |
function ($query_args, $attributes) { | |
if ( | |
isset($attributes['uniqueId']) | |
&& | |
$attributes['uniqueId'] === '9afc2324' | |
) { |
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( | |
'blocksy:pro:content-blocks:condition-match', | |
function ($matches, $content_block_id) { | |
if ($content_block_id === 15054) { | |
$resume_id = get_queried_object_id(); | |
if (! resume_manager_user_can_view_resume($resume_id)) { |
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_action( | |
'init', | |
function () { | |
global $wpdb; | |
$wpdb->query( | |
" | |
DELETE |
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 (! function_exists('write_log')) { | |
function write_log($log) { | |
if (is_array($log) || is_object($log)) { | |
error_log(print_r($log, true)); | |
} else { | |
error_log($log); | |
} | |
} |
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( | |
'rest_post_search_query', | |
function ($args) { | |
$args['post_type'] = array_diff( | |
$args['post_type'], | |
['ct_content_block'] | |
); |
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( | |
'blocksy:pro:custom-post-type:output-content', | |
function ($content, $id) { | |
$BLOCKSY_THANK_YOU_PAGE_ID = 2478; | |
if ($id !== $BLOCKSY_THANK_YOU_PAGE_ID) { | |
return $content; | |
} |
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( | |
'blocksy:pro:woocommerce-extra:swatches:has-single-product-swatches', | |
function ($has_single_product_swatches) { | |
global $product; | |
if (has_term(array('sneakers'), 'product_cat', $product->get_id())) { | |
return false; | |
} |
NewerOlder