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( 'http_request_args', 'freemius_http_request_args_filter', 1, 2 ); | |
add_filter( 'http_request_args', 'freemius_http_request_args_filter', 9999, 2 ); | |
function freemius_http_request_args_filter( $parsed_args, $url ) { | |
if ( false === strpos( $url, '://api.freemius.com' ) ) { | |
return $parsed_args; | |
} |
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 | |
// Check if the webhook should be fired. | |
if ( ! isset( $_GET['mailme'] ) ) { | |
return; | |
} | |
// Check if there is POST request. | |
if ( empty( $_POST ) ) { | |
return; |
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 | |
register_activation_hook( __FILE__, 'ssp_setup_static_daily_export_cron' ); | |
/** | |
* Setup a cron job to run daily. | |
* | |
* @return void | |
*/ | |
function ssp_setup_static_daily_export_cron() { | |
if ( ! wp_next_scheduled( 'ssp_static_export_daily_cron' ) ) { |
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 | |
// First we add the titles for the columns. | |
add_filter( 'filr_header_columns', function( $columns ) { | |
// You can add as many columns as you like here. | |
$columns['purchase-order-number'] = array( | |
'title' => esc_html__( 'Purchase Order Number', 'textdomain' ), | |
'hide' => 'off', | |
); |
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( 'ssp_single_export_additional_urls', function ( $related_urls ) { | |
global $wpdb; | |
// Get all pages that have a recent posts shortcode. | |
$page_ids = $wpdb->get_row( "SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[recent_posts AND post_type='page'", ARRAY_A ); | |
foreach ( $page_ids as $id ) { | |
$related_urls[] = get_permalink( $id ); |
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_action( 'filr_before_check_expire_date', function( $expiration_date, $today ) { | |
$difference = $expiration_date->diff( $today ); | |
// Get difference in days. | |
if ( $difference->d <= 2 ) { | |
// prepare and send the e-mail. | |
$to = '[email protected]'; | |
$subject = 'File will expire in 2 days.'; |
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('upload_mimes', 'custom_upload_xml'); | |
function custom_upload_xml($mimes) { | |
$mimes = array_merge($mimes, array('xml' => 'application/xml')); | |
return $mimes; | |
} |
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('ss_match_tags', function( $match_tags ) { | |
$match_tags['link'] = array( 'href' ); | |
return $match_tags; | |
}); |
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_action('ss_after_cleanup', function(){ | |
// Get options from Simply Static. | |
$options = get_option( 'simply-static' ); | |
$basic_auth = $options['http_basic_auth_digest']; | |
// Prepare URL and data. | |
$url = 'https://test.com'; | |
$data = []; |
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 | |
function add_description_attribute_field() { | |
$id = isset( $_GET['edit'] ) ? absint( $_GET['edit'] ) : 0; | |
$value = $id ? get_option( "wc_attribute_custom_description-$id" ) : ''; | |
?> | |
<tr class="form-field"> | |
<th scope="row" valign="top"> | |
<label for="custom-description"><?php esc_html_e('Description', ''); ?></label> | |
</th> |