NextGEN Ecommerce – apply the default pricelist to all of the existing galleries

use Imagely\NGG\Settings\Settings; use Imagely\NGGPro\Commerce\DataMappers\Gallery as GalleryMapper; function apply_default_pricelist_to_all_galleries() { $settings = Settings::get_instance(); $default_pricelist = $settings->get(‘ecommerce_default_pricelist’, null); if (!$default_pricelist) { return; } $mapper = GalleryMapper::get_instance(); $all_galleries = $mapper->find_all(); if ($all_galleries) { foreach ($all_galleries as $gallery) { $gallery->pricelist_id = $default_pricelist; $mapper->save($gallery); }…Continue reading

NextGEN Ecommerce – apply the default pricelist to all of the existing galleries

use Imagely\NGG\Settings\Settings; use Imagely\NGGPro\Commerce\DataMappers\Gallery as GalleryMapper; function apply_default_pricelist_to_all_galleries() { $settings = Settings::get_instance(); $default_pricelist = $settings->get(‘ecommerce_default_pricelist’, null); if (!$default_pricelist) { return; } $mapper = GalleryMapper::get_instance(); $all_galleries = $mapper->find_all(); if ($all_galleries) { foreach ($all_galleries as $gallery) { $gallery->pricelist_id = $default_pricelist; $mapper->save($gallery); }…Continue reading

expose acf

function expose_acf_to_rest() { register_rest_field(‘game_state’, ‘acf’, [ ‘get_callback’ => function($post_arr) { return get_fields($post_arr[‘id’]); }, ‘update_callback’ => null, ‘schema’ => null, ]); } add_action(‘rest_api_init’, ‘expose_acf_to_rest’);Continue reading

[reach_score]

/** * REACH/Wilson 2012 Secondary CV Risk Calculator * Shortcode: [reach_score] * * – Displays user data & final 20-month risk in a Bootstrap table. * – Region dropdown (NA/Western Europe, Eastern Europe/Middle East, Japan/Australia). * – Fetches user data…Continue reading

MemberPress: Generate All Invoices for the Specific Period (e.g. A Year)

function generate_bulk_invoices() { if(isset($_REQUEST[‘generate-invoices’])) { global $wpdb; $query = “SELECT id FROM {$wpdb->prefix}mepr_transactions WHERE created_at > ‘2025-01-01 00:00:00’ AND created_at < '2025-12-31 23:59:59' AND status IN ('complete', 'confirmed', 'refunded')"; $txn_ids = $wpdb->get_results($query); foreach($txn_ids as $txn_id) { $invoices = new MePdfInvoicesCtrl();…Continue reading

MemberPress: Add the Invoice Number to the Transactions Screen

add_filter(‘mepr-admin-transactions-cols’, function ($cols) { $cols[‘col_txn_invoice’] = __(‘Invoice No.’, ‘memberpress-pdf-invoice’); return $cols; }); add_action(‘mepr-admin-transactions-cell’, function ($column_name, $rec, $attributes) { if ($column_name === ‘col_txn_invoice’) { ?>Continue reading

Envira – Disable Distraction Free Mode for the Lightbox

/* Envira – Disable Distraction Free Mode for the Lightbox * * @link https://enviragallery.com/docs/how-to-enable-the-envira-distraction-free-mode/ */ add_filter( ‘envira_gallery_get_config’, ‘my_envira_gallery_get_config’, 10, 2 ); function my_envira_gallery_get_config( $data_config, $key ) { if ( $key === ‘idle_time’ ) { $data_config[‘idle_time’] = 60; // false would…Continue reading