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
/** * 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
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
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
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
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
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
add_filter( ‘wfea_event_time’, function ( $event_time, $start, $end ) { // do you stuff to update $event_time return $event_time; }, 10, 1 );Continue reading