Skip to content

Instantly share code, notes, and snippets.

View meravi's full-sized avatar
🙂
Lack of direction, not lack of time, is the problem.We all have 24 hour days.

Developer Ravi meravi

🙂
Lack of direction, not lack of time, is the problem.We all have 24 hour days.
View GitHub Profile
$(function() {
$("#slider-range").slider({
range: true,
min: 0,
max: 100000,
values: [500, 5000],
//step:function(event, ui),
slide: function(event, ui) {
$("#amount").val('$' + ui.values[0] + ' - $' + ui.values[1]);
<?php
// Add a function to check user access on template redirect
//add_action('wp_head', 'drt_restrict_page_access');
//add_action('wp_footer', 'drt_display_notice_after_footer');
add_action('template_redirect', 'drt_restrict_page_access', 11);
function drt_restrict_page_access()
{
@meravi
meravi / drt-working.php
Created June 6, 2024 04:49
working on range slider
<?php
// Add a function to check user access on template redirect
//add_action('wp_head', 'drt_restrict_page_access');
//add_action('wp_footer', 'drt_display_notice_after_footer');
add_action('template_redirect', 'drt_restrict_page_access', 11);
function drt_restrict_page_access()
{
@meravi
meravi / drt.php
Created June 5, 2024 14:52
testing....
<?php
// Add a function to check user access on template redirect
//add_action('wp_head', 'drt_restrict_page_access');
//add_action('wp_footer', 'drt_display_notice_after_footer');
add_action('template_redirect', 'drt_restrict_page_access', 11);
function drt_restrict_page_access()
{
@meravi
meravi / savecard.php
Last active December 6, 2023 07:08
save card shortcode.
function aba_save_card_shortcode() {
ob_start();
?>
<!-- Include PHP class -->
<?php
require_once plugin_dir_path(__FILE__) . 'PayWayApiCheckout.php';
$transactionId = time();
$firstName = 'hj';
@meravi
meravi / gdc-tax.php
Last active October 5, 2023 10:23
wp_editor not working
/* test */
// Register Taxonomy GdC Ingredient
// Taxonomy Key: gdc_ingredient1
function create_gdcingredient_tax() {
$labels = array(
'name' => _x( 'GdC Ingredient', 'taxonomy general name', 'textdomain' ),
'singular_name' => _x( 'GdC Ingredient', 'taxonomy singular name', 'textdomain' ),
'search_items' => __( 'Search GdC Ingredient', 'textdomain' ),
@meravi
meravi / clickable-link-inside-accordion-content.php
Created August 16, 2022 11:25
how to make link clickable in ui accordion content.
@meravi
meravi / session-solver.php
Created June 2, 2022 07:17
redirection using session.
// we can do samethings using wp_loaded also.
add_action( 'init', function() {
$status = session_status();
if ( PHP_SESSION_DISABLED === $status ) {
return;
}
if ( PHP_SESSION_NONE === $status ) {
session_start();
@meravi
meravi / session-issue.php
Last active June 1, 2022 16:47
header already sent issue.
// note: always put session code in top of the functions.php
// error handling : If you only want to avoid the error, use @ before the function like this @session_start();
// example 1
add_action( 'template_redirect', function() {
$status = session_status();
if ( PHP_SESSION_DISABLED === $status ) {
// That's why you cannot rely on sessions!
@meravi
meravi / disable-specific-plugin.php
Last active May 17, 2022 17:06
disable specific plugin updates
function dr_remove_update_notifications( $value ) {
if ( isset( $value ) && is_object( $value ) ) {
unset( $value->response[ 'stripe-payments/accept-stripe-payments.php' ] );
}
return $value;
}
add_filter( 'site_transient_update_plugins', 'dr_remove_update_notifications' );