Skip to content

Instantly share code, notes, and snippets.

View phirebase's full-sized avatar
🌍
Working from home

David Klhufek phirebase

🌍
Working from home
View GitHub Profile
@phirebase
phirebase / languages-wp-cli-guide.md
Last active January 17, 2025 12:24
How to Initialize and Update `/languages` for a WordPress Plugin using WP-CLI

How to Initialize and Update /languages for a WordPress Plugin using WP-CLI

1️⃣ Create a .pot File

Generate the .pot file to include all translatable strings:

wp i18n make-pot . /languages/my-plugin.pot --domain=my-plugin
  • .: Root directory of your plugin.
@phirebase
phirebase / wp-cli-commands.md
Last active January 8, 2025 23:40
WP-CLI Quick Commands

WP-CLI Quick Commands

A collection of useful WP-CLI commands for managing your WordPress site effectively.

1️⃣ WordPress Core Management

Check WordPress version:

wp core version

Update WordPress:

@phirebase
phirebase / phpcs-phpcbf-guide.md
Last active January 26, 2025 13:45
PHPCS and PHPCBF Commands for WordPress

PHPCS and PHPCBF Commands for WordPress

1️⃣ Run PHPCS

Use the phpcs command to analyze your code:

phpcs --standard=WordPress ./path/to/your/file.php

2️⃣ Optional: Automatic Fixes with PHPCBF

cursor: pointer;
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".hyper_this").on('click', function(){
window.location = "https://divinotes.com/free-premium-divi-theme-layouts/";
});
});
</script>
@jamesfosker
jamesfosker / functions.php
Last active November 5, 2021 02:36
Change the slugs of project post, project category and project tags, add this to your child theme functions.php, once you've changed the slug on line 5, 20 & 38, go to your dashboard and go setting/permalinks and just hit the save button to update the slugs
/*Change Project Post Type Slug*/
function ds_divi_modify_project_post_slug() {
return array(
'feeds' => true,
'slug' => 'new-slug', /*Change text between brackets*/
'with_front' => false,
);
}
add_filter( 'et_project_posttype_rewrite_args', 'ds_divi_modify_project_post_slug' );
@indikatordesign
indikatordesign / functions.php
Last active November 5, 2021 01:29
[Combine "Divi - Filterable Blog Module" with the "Events Manager" plugin]
<?php
// Here you can see how to combine "Divi - Filterable Blog Module" with the free plugin "Events Manager": https://wordpress.org/plugins/events-manager/
// Just add these snippets to your themes functions.php and change them according to your needs.
// Combine Event Manager with "Divi – Filterable Blog Module" by changing the $query_args
// If you use it like this, the sorting starts with the current event and past events will be hidden automatically
add_filter( 'dfbm_query_args_output', function( $query_args )
{
@yanknudtskov
yanknudtskov / wordpress-db-get-autoload-size.sql
Created October 18, 2017 12:33
This will show you the autoloaded data size, how many entries are in the table, and the first 10 entries by size. #optimization #database #mysql
SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes'
UNION
SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes'
UNION
(SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 10)
@sheerun
sheerun / .bowerrc
Last active March 19, 2023 02:27
Proper .bowerrc file pointing to new Bower registry (if using legacy Bower version)
{
"registry": "https://registry.bower.io"
}
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active April 24, 2025 10:23
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################