Skip to content

Instantly share code, notes, and snippets.

View vburlak's full-sized avatar
🚀

Vladislav Burlak vburlak

🚀
View GitHub Profile
@sftsk
sftsk / launch.json
Last active December 18, 2019 16:47
XDebug with Local & Bedrock
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
@prasetyop
prasetyop / admin.css
Last active March 13, 2023 13:33
Flexible Content Preview Pop Up
.acf-fc-popup .preview {
position: absolute;
right: 100%;
margin-right: 0px;
top: 0;
background: #383c44;
min-height: 100%;
border-radius: 5px;
align-content: center;
display: grid;
<?php
namespace App;
use function \Sober\Intervention\intervention;
if (function_exists('Sober\Intervention\intervention')) {
// Add Welcome Dashboard
intervention('add-dashboard-item', [
'Welcome',
@MARQAS
MARQAS / hidebulkpost
Created May 16, 2017 11:49
Filter to Hide bulk posts in AMP
add_filter( 'amp_skip_post', 'ampforwp_skip_amp_post', 10, 3 );
function ampforwp_skip_amp_post( $skip, $post_id, $post ) {
$ampforwp_skip_posts_in = array(postid1, postid2, postid3, ....,postidn);
if( in_array( $post_id, $ampforwp_skip_posts_in ) ) {
$skip = true;
}
return $skip;
}
@shashankmehta
shashankmehta / setup.md
Last active November 18, 2024 18:33
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@dluco-
dluco- / Readme.md
Last active January 2, 2023 14:34
Setting up Xdebug to work with trellis and Visual Studio Code.
@amboutwe
amboutwe / yoast_seo_sitemap_add_custom_type.php
Last active September 10, 2025 15:48
Filters and example code for Yoast SEO sitemaps
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Create a Yoast SEO sitemap for a custom post type
* Credit: Team Yoast
* Last Tested: Unknown
* Documentation: https://developer.yoast.com/features/xml-sitemaps/api/#add-a-custom-post-type
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* HOW TO USE
* Replace TYPE with your custom type
@discopatrick
discopatrick / sync-dev.yml
Last active January 19, 2022 16:36
A playbook for use with roots/trellis syncing the local wordpress db and uploads folder to a remote installation.
---
- name: sync uploads and db from staging to local
hosts: my_staging_host
remote_user: "{{ web_user }}"
pre_tasks:
- name: Ensure site is valid
connection: local
fail:
msg: "Site `{{ site | default('') }}` is not valid. Available sites to sync: {{ wordpress_sites.keys() | join(', ') }}"
@tripflex
tripflex / functions.php
Last active March 19, 2025 11:59
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@mcaskill
mcaskill / Function.HTML-Build-Attributes.php
Last active January 8, 2024 04:14
PHP / WordPress : Generate a string of HTML attributes
<?php
if (!function_exists('html_build_attributes')) {
/**
* Generate a string of HTML attributes
*
* @param array $attr Associative array of attribute names and values.
* @param callable|null $callback Callback function to escape values for HTML attributes.
* Defaults to `htmlspecialchars()`.
* @return string Returns a string of HTML attributes.