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 | |
/** | |
* Filter out sites to show in cloning list. | |
*/ | |
add_filter( 'ns_cloner_sites_list', function( $sites ) { | |
$my_site_ids = array( 1, 10, 3, 8, 13 ); // The site ids you only want to show. Replace with the ids of your sites. | |
foreach ( $sites as $id => $name ) { | |
if ( ! in_array( $id, $my_site_ids, true ) ) { | |
unset( $sites[ $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_filter( 'ns_cloner_site_tables', 'customer_exclude_ns_cloner_site_tables', 10, 2 ); | |
/** | |
* Exclude certain tables from cloning. | |
* | |
* @param array $tables The selected tables. This contains the prefix | |
* @param int $site_id The site 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 | |
$array_of_post_types = array( | |
'attachment', | |
'page', | |
'post', | |
'revision', | |
'wp_global_styles', | |
); | |
$array_of_tables = array( | |
'wp_commentmeta', |
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 custom_mcf_check_order_tracking_details() { | |
global $ns_fba_inst; | |
if ( ! is_object( $ns_fba_inst ) ) { | |
return; | |
} | |
$orders = get_posts( |
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( 'woocommerce_shipping_method_title', 'change_mcf_shipping_method_title', 10, 2 ); | |
/** | |
* Modify the method shipping title. | |
* This will affect both the title and the method title. | |
* | |
* @param string $method_title The method title. | |
* @param WC_Shipping_Method $shipping_class The shipping method. |
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 | |
$array_of_post_types = array( | |
'attachment', | |
'page', | |
'post', | |
'product', | |
'revision', | |
'wp_global_styles', | |
); | |
$array_of_tables = array( |
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
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
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 copy_post( $post_id ) { | |
if ( function_exists( 'PLL' ) ) { | |
$model = PLL()->model; | |
$post = get_post( $post_id ); | |
$post->ID = null; | |
$translations = pll_get_post_translations( $post_id ); | |
foreach ( $model->get_languages_list() as $language ) { | |
$tr_id = pll_get_post( $post_id, $language ); |
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
// License: GPLv2+ | |
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
ServerSideRender = wp.components.ServerSideRender, | |
TextControl = wp.components.TextControl, | |
InspectorControls = wp.editor.InspectorControls; | |
/* | |
* Here's where we register the block in JavaScript. |
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 | |
/** | |
* Delete old Defender logs from all sites | |
* Clean up custom post meta that is no longer used | |
* call the function defender_delete_old_posts() | |
* | |
* @param bool $echo - echo the tables | |
*/ | |
function defender_delete_old_posts( $echo = false ) { | |
global $wpdb; |
NewerOlder