Maintenance Mode

add_action( ‘init’, function() { if ( ! current_user_can( ‘manage_options’ ) && ! is_admin() && ! is_login() ) { wp_die( ‘This website is currently undergoing scheduled maintenance. Please try again later.’ ); } } );Continue reading

WP Simple Pay: Custom API Keys

/** * Returns the Stripe Secret key. */ function get_secret_key( $key ) { return ‘sk_live_123’; } add_filter( ‘simpay_stripe_api_secret_key’, ‘get_secret_key’ ); add_filter( ‘simpay_secret_key’, ‘get_secret_key’ ); /** * Returns the Stripe Publishable key. */ function get_publishable_key( $key ) { return ‘pk_live_123’; }…Continue reading

RT7 Official – Maintenance Mode (copy)

function custom_maintenance_mode() { if ( ! is_user_logged_in() ) { header( ‘HTTP/1.1 503 Service Temporarily Unavailable’ ); header( ‘Content-Type: text/html; charset=utf-8’ ); header( ‘Retry-After: 3600’ ); // You can change this value to set a different retry time (in seconds). ?>…Continue reading

Require Downloadable fields – Downloadable product template

add_filter( ‘wcvendors_pro_product_form_download_files_path’, ‘make_required’ ); add_filter( ‘wcvendors_pro_product_form_product_attributes_path’, ‘make_required’ ); add_filter( ‘wcv_product_dowlnoad_limit’, ‘make_required’ ); add_filter( ‘wcv_product_download_expiry’, ‘make_required’ ); function make_required( $field ){ $field[‘custom_attributes’] = array( ‘required’ => ” ); return $field; }Continue reading

AIOSEO – Increase SEO Analyzer TimeOut

add_filter( ‘http_request_args’, ‘aioseo_filter_analyzer_timeout’, 1, 2 ); function aioseo_filter_analyzer_timeout( $args, $url ) { if ( ‘https://analyze.aioseo.com/v1/analyze/’ === $url ) { $args[‘timeout’] = 120; } return $args; }Continue reading

WP Simple Pay: Multiple Price Option Label Smart Tag

add_filter( ‘simpay_payment_details_template_tags’, function( $smart_tags ) { $smart_tags[] = ‘selected-price-label’; return $smart_tags; } ); add_filter( ‘simpay_payment_confirmation_template_tag_selected-price-label’, function( $value, $payment_confirmation_data ) { if ( empty( $payment_confirmation_data[‘subscriptions’] ) ) { $payments = $payment_confirmation_data[‘paymentintents’]; $payment = current( $payments ); return $payment->description; } $subscriptions =…Continue reading

Bricks Builder Improvements (back end)

/* Bricks Builder Editor Tweaks */ /* — Reorder pinned elements */ .bricks-add-element[data-element-name=”section”] { order: 1; } .bricks-add-element[data-element-name=”container”] { order: 2; } .bricks-add-element[data-element-name=”block”] { order: 3; } .bricks-add-element[data-element-name=”div”] { order: 4; } .bricks-add-element[data-element-name=”heading”] { order: 5; } .bricks-add-element[data-element-name=”text”] { order:…Continue reading

Change Schema Type of All Posts in Specific Categories

add_filter(‘aioseo_schema_output’, ‘change_schema_type_in_specific_categories’); function change_schema_type_in_specific_categories($schema) { // Specify the category slugs you want to target $target_category_slugs = array(‘category1-slug’, ‘category2-slug’, ‘category3-slug’); foreach ($schema as &$schemaItem) { // Check if the post belongs to any of the specified categories if (isset($schemaItem[‘@type’]) && ‘NewsArticle’…Continue reading