SSH to your site and go to the root folder of the WordPress installation and do
wp db export
Move outside the root folder of WordPress and compress the folder (The db fils is located in the root folder and will be included).
/** | |
* Requires Plugin: Google Tag Manager for Wordpress & WooCommerce Cost of Goods | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
function gtm4wp_add_profit_datalayer_data( $dataLayer ){ | |
if ( is_order_received_page() ){ | |
$orderID = $dataLayer['ecommerce']['purchase']['actionField']['id']; | |
$orderItems = $dataLayer['ecommerce']['purchase']['products']; |
/** | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
* | |
* custom_rest_api_authentication_token | |
* | |
* Protect REST API from the public | Generate token: https://bit.ly/2W5qDrB | |
* | |
* @param obj $wp_rest_server |
/** | |
* Title: Remove Page content editor for specific template | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
add_action('admin_init', 'mg_remove_editor_init'); | |
function mg_remove_editor_init() { | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; | |
$template = get_post_meta( $post_id, '_wp_page_template', true ); |
/** | |
* Title: Gravity Forms send entry to child site (WP | Enable GF REST API on child site) | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
add_action( 'gform_after_submission_2', 'post_to_third_party', 10, 2 ); | |
function post_to_third_party( $entry, $form ) { | |
$entry['form_id'] = 1; // change form ID to same ID on your child site |
/** | |
* Title: Populate ACF select field options with Gravity Forms forms | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
function acf_populate_gf_forms_ids( $field ) { | |
if ( class_exists( 'GFFormsModel' ) ) { | |
$choices = []; | |
// $choices[ $form->id ] = 'Select a form'; |
/** | |
* Title: Menu change link source by user role | |
* Description: Changes source(href) list all venues link by user role | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
add_filter( 'nav_menu_item_args', 'change_menu_link_by_user_role', 10, 2 ); | |
function change_menu_link_by_user_role( $args, $item ) { | |
// if ( 'primary' !== $args->theme_location ) { |
/** | |
* Title: Gravity Forms display price | |
* Description: Display (has) price on Drop Down and Radio Button Product Fields | |
* Source: https://www.gravityhelp.com/documentation/article/gform_field_choice_markup_pre_render/#2-include-price-for-product-fields | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
add_filter( 'gform_field_choice_markup_pre_render', function ( $choice_markup, $choice, $field, $value ) { |
::Title: UnRAR/UnZip files in sub directory's + rename + move | |
::Author: Mattias Ghodsian | |
::Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
::Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
SETLOCAL ENABLEEXTENSIONS | |
FOR /D /r %%F in ("*") DO ( | |
pushd %CD% | |
cd %%F |
/** | |
* Title: Add missing Schema WooCommerce | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
function woo_missing_schema_fields($data) { | |
global $product; |