Skip to content

Instantly share code, notes, and snippets.

@SteveJonesDev
SteveJonesDev / accessible-menu.php
Last active January 22, 2025 04:42
Accessible WordPress Navigation Menu
<div class="menu-container">
<button class="menu-button" aria-expanded="false" aria-controls="site-header-menu" aria-label="<?php esc_attr_e( 'Menu', 'textdomain' ); ?>"></button>
<div id="site-header-menu" class="site-header-menu">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container' => 'nav',
'container_class' => 'main-navigation',
'container_id' => 'site-navigation',
@joseph-farruggio
joseph-farruggio / get_parent_block_field.php
Last active January 22, 2023 23:12
Returns a specified field from the parent ACF block.
<?php
/**
* Returns a specified ACF field from a parent block
* @param string $child_id The ID of the child ACF block
* @param string $child_name The name of the child ACF block
* @param string $parent_name The name of the parent ACF block
* @param string $field The name of the parent's custom field to return
* @param boolean $return_first If $field is an array, optionally return the first item.
*/
function get_field_from_parent($child_id, $child_name, $parent_name, $field, $return_first = false) {
@Dasutin
Dasutin / retronas_on_unraid.md
Last active February 20, 2025 21:42
RetroNAS on Unraid

RetroNAS on Unraid

This guide is intended for installing RetroNAS on an already configured Unraid server. If you're not familiar with Unraid or RetroNAS, head over to the RetroNAS GitHub page to learn about RetroNAS and consider setting it up on a Raspberry Pi.

Unraid NFS Setup

Within Unraid, enable NFS by going to Settings and NFS.

  • Enable NFS: Yes
  • Click Apply
@masonjo
masonjo / Dataset (Faster)
Created February 1, 2022 23:48
DataTables for ptclinic8
<?php
if (!defined('canInclude')) {
header('Location:/ca/report/?page=_base');
}
$hide_pager = true;
$todoPresetData = ORM::for_table('todo_preset')->where_not_equal('retired', 1)->find_array();
$todoPresetData = json_encode($todoPresetData);
?>
<div class="container-fluid m-a-xs" >
<div class="row" >
@taskylizard
taskylizard / fmhy.md
Last active February 26, 2025 21:13
/r/freemediaheckyeah, in one single file (view raw)
@andberry
andberry / jquery-document-ready-vanilla-javascript.js
Last active October 26, 2021 09:37
jQuery $(document).ready() in vanilla JavaScript
/*
https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event
- The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed,
without waiting for stylesheets, images, and subframes to finish loading.
- A different event, load, should be used only to detect a fully-loaded page.
https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState
- loading: The document is still loading.
- interactive: The document has finished loading and the document has been parsed but sub-resources such as scripts, images, stylesheets and frames are still loading.
- completeThe document and all sub-resources have finished loading. The state indicates that the load event is about to fire.
@petertwise
petertwise / acf-install-license
Last active October 24, 2024 09:37 — forked from polevaultweb/acf_pro_license_constant.php
Define the Advanced Custom Fields Pro license key with a constant
#!/bin/bash
# Setup ACF Pro to use a license key in wp-config
#
# 1. Place your license key in a file called .acf-license-key somewhere your ssh user has access to it.
# Default is in your home directory: ~/.acf-license-key
# Change the setting below if you need to put it somewhere else
# 2. install this file in /usr/local/bin or someplace in your PATH
# 3. make sure you have WP CLI installed
# 4. run acf-install-license from the root of your wordpress install
@eddychilakiller
eddychilakiller / data-table.js
Last active November 29, 2024 08:20
Data table
$(document).ready(function() {
var table = $('#example').DataTable( {
ajax: "data/data.json",
lengthMenu: [ 20, 50 ],
pagingType: "full_numbers",
initComplete: function() {
$('.dataTables_filter input').unbind();
var input = $('.dataTables_filter input').unbind(),
self = this.api(),
$searchButton = $('<button>')
@bluewalk
bluewalk / GetNordVPNWireGuardDetails.md
Last active February 19, 2025 07:03
Getting NordVPN WireGuard details

About

Instructions to obtain WireGuard details of your NordVPN account. These can be used to setup a WireGuard tunnel on your router to NordVPN.

Source: https://forum.gl-inet.com/t/configure-wireguard-client-to-connect-to-nordvpn-servers/10422/27

Prerequisites

If you have any linux machine, use that or install a vm if you don't have one.

Get their official linux app installed. Make sure you have wireguard installed too. And set the used technology to Nordlynx by running nordvpn set technology nordlynx

@doubleedesign
doubleedesign / acf-tsf-integration.php
Last active December 9, 2022 13:06
Get meta descriptions in The SEO Framework from ACF flexible content fields
<?php
/**
* The SEO Framework + ACF flexible content integration
* TSF will look at the excerpt and then the content to generate the default meta description.
* If both of those are empty, this code looks for ACF flexible modules to get it from.
* // TODO: Make this work with archives as well as posts
* @param $description
* @param $args
*
* @return mixed|string