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 | |
| // 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 | |
| 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 | |
| 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 | |
| /** | |
| * 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 | |
| /** | |
| * 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 | |
| /** | |
| * 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
| /** | |
| * Programmatically add/select term on Gutenberg editor. | |
| * On this function we are also ready if the classic-editor is loaded. | |
| * Related issue: https://github.com/WordPress/gutenberg/issues/15147 | |
| */ | |
| $('.bike-types').on('click', '.bike-type-item', function() { | |
| var tag_id = $( this ).data( 'id' ); | |
| var tag_name = $( this ).data( 'name' ); | |
| if ( typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined' ) { |
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 | |
| /** | |
| * Bail out a plugin activation, even before the plugin file is loaded. | |
| * Using this hook will prevent any PHP fatal error, because of any defined constants, class names or functions. | |
| */ | |
| function bail_out_standalone_plugin_activation( $action, $result ) { | |
| $plugin_name = 'YourPluginName'; | |
| $plugin_file_name = '/yourpluginname.php'; | |
| $activate_plugin_referer = 'activate-plugin_'; |