This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Upload and Preview Image</title> | |
</head> | |
<body> | |
<form action="" method="post" enctype="multipart/form-data"> | |
<input |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Preview image: https://i.imgur.com/5FxW6x3.png | |
This is for modify the product name in cart page. | |
*/ | |
add_filter( 'woocommerce_product_title', 'cart_product_title', 20, 2 ); | |
function cart_product_title( $title, $values ) { | |
return $title . ' extra cheese burger'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createReduxStore, register } from '@wordpress/data'; | |
export const DEFAULT_STATE = { | |
drag: { | |
source: 'panel', //null, | |
uid: null, | |
id: 'heading', //null, heading, container, | |
draggingNode: null, | |
}, | |
isDragging: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<input type="text" onkeyup="betterSearch()" id="name"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Preview Backend: https://i.imgur.com/hyLOnlI.png | |
// Preview Frontend: https://i.imgur.com/hyLOnlI.png | |
// Add new tab in the backend. | |
add_filter( 'woocommerce_product_data_tabs', 'sfc_add_product_data_to_tab' ); | |
function sfc_add_product_data_to_tab( $default_tabs ) { | |
global $post; | |
$tabs = array( | |
'sfc_phone_email' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_order_meta_by_key3( $meta_key = 'order_status' ) { | |
// Check if the data is already cached. | |
$cache_key = 'order_meta_cache_' . $meta_key; | |
$cached_data = get_transient( $cache_key ); | |
if ( false !== $cached_data ) { | |
return $cached_data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Awesome API Test | |
* Description: Awesome Desc... | |
* Plugin URI: # | |
* Version: 1.0 | |
* Author: # | |
* Author URI: http://github.com/anisur2805/ | |
* Text Domain: test-domain | |
* License: GPL v2 or later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><a href="">Item 1</a></li> | |
<li><a href="">Item two</a></li> | |
<li><a href="">Item three</a></li> | |
<li><a href="">Item4</a></li> | |
<li><a href="">Item5</a></li> | |
<li><a href="">Item6</a></li> | |
<li><a href="">Item7</a></li> | |
<li><a href="">Item8</a></li> | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_template_include($template) { | |
if (is_page('test')) { // your desiger page | |
$new_template = IC_CORE_PATH . '/templates/custom-template.php'; // your desier file | |
if (file_exists($new_template)) { | |
return $new_template; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Step #1: | |
// In this case the problem was i have a category/ taxonomy select field in gravity form and its value was id where as my requirement was use name. So i firstly use `gform_pre_render` filter hook to change the options value with name. My select field ID was 38. | |
add_filter( 'gform_pre_render', 'modify_select_field_options' ); | |
function modify_select_field_options( $form ) { | |
foreach ( $form['fields'] as &$field ) { | |
if ( $field->type === 'select' && $field->id === 38 ) { | |
$categories = get_terms( array( | |
'taxonomy' => 'services-category', | |
'hide_empty' => false, |