Skip to content

Instantly share code, notes, and snippets.

View essambarghsh's full-sized avatar
💭
GitHub is not a social network

Essam Barghsh essambarghsh

💭
GitHub is not a social network
View GitHub Profile
@essambarghsh
essambarghsh / wordpress-6-2-2-docker-compose.yml
Created April 23, 2024 03:39 — forked from erikyuzwa/wordpress-6-2-2-docker-compose.yml
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1
# If you're on something newer, then double check against this release.
#
@essambarghsh
essambarghsh / WP-HTML-Compression
Created March 26, 2024 07:37 — forked from sethbergman/WP-HTML-Compression
Minify HTML for WordPress without a Plugin - Add to function.php
<?php
class WP_HTML_Compression
{
// Settings
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
// Variables
@essambarghsh
essambarghsh / wp-recursive-menu.php
Created February 23, 2024 12:53 — forked from bUxEE/wp-recursive-menu.php
Recursive menu/submenu list from wp_get_nav_menu_items. Change menu name and style to your needs. Supports unlimited number of submenus.
<?php
$menu_name = 'menu-name';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );
//echo '<pre>'.print_r($menuitems).'</pre>';
function buildTree( array &$elements, $parentId = 0 )
{