Skip to content

Instantly share code, notes, and snippets.

@dimitarminchev
dimitarminchev / borica_request.php
Last active October 30, 2024 04:46
Borica Request 4.0
<?php
/*
# Borica Request 4.0
Изпращане на заявка за извършване на електронно плащане: [borica_request.php](https://gist.github.com/dimitarminchev/08d8ab833fa481a8cc5c1e365a16c05e)
- Документация: [Borica APGW e-Gateway Resources](https://3dsgate-dev.borica.bg/)
- Автор: [доц. д-р Димитър Минчев](http://www.minchev.eu)
- Eлектронна поща: [mitko@bfu.bg](mailto:mitko@bfu.bg)
*/
// Gateway
@damiencarbery
damiencarbery / add-required-attribute.js
Last active April 23, 2021 09:19
Make the 'Weight' field required in WooCommerce Edit Product page.
jQuery(document).ready(function($){
$('#_weight').prop('required',true); // Set weight field as required.
});
@groupewibi
groupewibi / ACF Form : Change Title Name and Instructions
Last active May 25, 2019 18:01
Changing the title and the label of the Title Post using ACF Form
function my_acf_prepare_field( $field ) {
if ( is_page('page-name') ) {
$field['label'] = "My new title";
$field['instructions'] = "My new instruction";
}
if ( $field ) { return $field; } else { exit; }
@amboutwe
amboutwe / yoast_seo_breadcrumb_add_woo_shop.php
Last active September 17, 2025 12:07
Multiple examples of how to customize the Yoast SEO breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Add shop link to the Yoast SEO breadcrumbs for a WooCommerce shop page.
* Credit: https://wordpress.stackexchange.com/users/8495/rjb
* Last Tested: Apr 20 2017 using Yoast SEO 4.6 on WordPress 4.7.3
*/
add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link' );
@cryptexvinci
cryptexvinci / remove_checkout_fields.php
Last active November 14, 2025 06:07
Remove fields from WooCommerce checkout page.
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
@amboutwe
amboutwe / yoast_seo_breadcrumb_remove_link.php
Last active August 8, 2024 18:25
These snippets are examples of how you can modify the Yoast SEO breadcrumb visual output. These snippets will not alter the breadcrumb schema output. Please consult the schema documentation to change the breadcrumb schema: https://developer.yoast.com/features/schema/api#to-add-or-remove-graph-pieces
@vishalkakadiya
vishalkakadiya / manage_columns_wp_admin.php
Last active August 6, 2024 08:58
Manage custom columns with sortable in WordPress Admin side
<?php
/*
* =================================================================================================
* Below both hooks works for custom post types.
* e.g. Suppose we have custom post-type name : Books
* @ref https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column
* =================================================================================================
*/
@stvhwrd
stvhwrd / website-dl.md
Last active July 2, 2025 22:31
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@jonathanstark
jonathanstark / verify-google-recaptcha-with-php
Last active July 16, 2024 17:06
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@ranacseruet
ranacseruet / VideoStream.php
Last active November 12, 2025 17:53
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";