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 the cron on plugin loaded. | |
* Valid values for the recurrence are ‘hourly’, ‘daily’, and ‘twicedaily’. | |
* @return void | |
*/ | |
function harisrozak_register_wp_cron() { | |
if ( ! wp_next_scheduled( 'harisrozak_wp_cron' ) ) { | |
wp_schedule_event( time(), 'twicedaily', 'harisrozak_wp_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 | |
/** | |
* Modify multisite childs subdomain path | |
* The main multisite path is on app.example.com | |
* And then it's children should be on foo.example.com, bar.example.com, etc. | |
* This code should be located on mu-plugins folder | |
*/ | |
if ( ! function_exists( 'harisrozak_change_site_subdomain' ) ) { | |
function commercioo_change_site_subdomain( $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 | |
/** | |
* LudicrousDB configuration file | |
* | |
* This file should be copied to ABSPATH/db-config.php and modified to suit your | |
* database environment. This file comes with a basic configuration by default. | |
* | |
* See README.md for documentation. | |
* |
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( 'customize_controls_print_scripts', 'custom_customize_controls_print_scripts', 30 ); | |
function custom_customize_controls_print_scripts() { | |
?> | |
<script type='text/javascript'> | |
jQuery( function( $ ) { | |
wp.customize.panel( 'customize_checkout_settings', function( section ) { | |
section.expanded.bind( function( isExpanded ) { | |
if ( isExpanded ) { |
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( 'rest_url', function( $url ) { | |
if ( is_ssl() ) { | |
$url = set_url_scheme( $url, 'https' ); | |
return $url; | |
} | |
return $url; | |
}); |
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 | |
// send data trough REST API | |
$request = new WP_REST_Request( 'POST', '/wp/v2/custom_post_type' ); | |
$request->set_header( 'content-type', 'application/json' ); | |
$request->set_body( wp_json_encode( $order_data ) ); | |
// get response | |
$response = rest_do_request( $request ); | |
$response_data = $response->get_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 | |
/** | |
* HyperDB configuration file | |
* | |
* This file should be installed at ABSPATH/db-config.php | |
* | |
* $wpdb is an instance of the hyperdb class which extends the wpdb class. | |
* | |
* See readme.txt for documentation. |
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 | |
/** | |
* Save ACF settings to json | |
*/ | |
add_filter( 'acf/settings/load_json', 'astahub_acf_json_load' ); | |
add_filter( 'acf/settings/save_json', 'astahub_acf_json_save' ); | |
function astahub_get_acf_path() { | |
return get_template_directory() . '/acf-json'; |