Skip to content

Instantly share code, notes, and snippets.

View ellegaarddk's full-sized avatar

ellegaarddk ellegaarddk

View GitHub Profile
@thisbit
thisbit / block_patterns_cpt.php
Last active July 20, 2022 07:26
WordPress Block Patterns as Custom Post Type and with Admin Menu item!
<?php
/*
Plugin Name: Custom Block Pattern Builder
Description: Plugin enables visual creation of block patterns in a dedicated CPT
Author: Name Lastname
Author URi: https://sitename.domain
Version: 1.0.0
Text Domain: prefix_
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.txt
@lukecav
lukecav / functions.php
Created January 10, 2018 03:22
Disable Elementor overview dashboard widget in WordPress
function disable_elementor_dashboard_overview_widget() {
remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'disable_elementor_dashboard_overview_widget', 40);
@Rarst
Rarst / GPLv2.php
Last active April 20, 2019 08:08
WordPress File Templates for PhpStorm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
<?php
// http://stackoverflow.com/questions/7952977/php-check-if-url-and-a-file-exists
function is_200($url) {
$options['http'] = array(
'method' => "HEAD",
'ignore_errors' => 1,
'max_redirects' => 0
);
$body = file_get_contents($url, NULL, stream_context_create($options));
@Rarst
Rarst / deprecated.md
Last active February 21, 2023 11:21
WordPress coding standards configuration for PhpStorm

Now Native

PhpStorm now bundles WordPress coding style natively, starting from version 8.

  1. Go to Project Settings > Code Style > PHP.
  2. Select Set From... (top right of window) > Predefined Style > WordPress.

No longer need to muck with this import! :)