Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
<?php
class WordPress_Custom_Status {
/**
* Post Types for this status
* @var array
*/
protected $post_type = array();
@dexit
dexit / featured-image-rest.php
Created July 7, 2025 09:05 — forked from norcross/featured-image-rest.php
Add featured image data to the REST API return
@dexit
dexit / widget.php
Created July 7, 2025 09:04 — forked from joelgoodman/widget.php
WordPress Widget for ACF Fields
<?php
/**
* ITS Related Links
*
* The WordPress Widget Boilerplate is an organized, maintainable boilerplate for building widgets using WordPress best practices.
*
*/
class ITS_Contact_Box extends WP_Widget {
@dexit
dexit / csv-export-example.php
Created July 7, 2025 09:04 — forked from norcross/csv-export-example.php
a basic CSV export example
<?php
/**
* Devin CSV Export
*
* Contains our export processing
*/
/*
Copyright 2015 Reaktiv Studios
This program is free software; you can redistribute it and/or modify
https://gist.github.com/paulund/6687336
https://wpdatatables.com/crud-system-in-wordpress/
https://www.davidangulo.xyz/how-to-create-crud-operations-plugin-in-wordpress/
https://wpdataaccess.com/2020/04/08/how-to-use-wp-data-access-classes-in-your-own-php-code/
https://paulund.co.uk/crud-queries-for-wordpress-custom-tables
@dexit
dexit / resume.json
Created July 3, 2025 01:42 — forked from bhubbard/resume.json
JSON Resume
{
"basics": {
"name": "Brandon Hubbard",
"label": "WordPress Developer",
"picture": "http://www.gravatar.com/avatar/3596404cbc9ffb7d4f48524e08340d86.png",
"email": "[email protected]",
"phone": "(818) 297-4175",
"website": "https://brandonhubbard.com",
"summary": "Web Developer Manager at Snap One",
"location": {
@dexit
dexit / elementor_script_dequeue_on_funnel_pages.php
Created July 2, 2025 16:21 — forked from xlplugins/elementor_script_dequeue_on_funnel_pages.php
Dequeue elementor scripts on page to avoid error when page is not built with elementor
/**
* Dequeues Elementor scripts and styles for FunnelKit Builder pages
*
* This function prevents loading unnecessary Elementor assets on FunnelKit Builder pages
* that are using canvas or boxed templates but not built with Elementor. This helps
* improve page load performance.
*
* The function checks:
* 1. If Elementor locations exist
* 2. If current post exists and is valid
@dexit
dexit / wc-add-google-structured-data.php
Created July 2, 2025 16:18 — forked from damiencarbery/wc-add-google-structured-data.php
Google Structured Data for WooCommerce: Keep Google happy by providing product info in a form it can easily read https://www.damiencarbery.com/2019/04/google-structured-data-for-woocommerce/
<?php
/*
Plugin Name: Google Structured Data for WooCommerce
Plugin URI: https://www.damiencarbery.com/2019/04/google-structured-data-for-woocommerce/
Description: Add Google Structured Data to WooCommerce products. Asked in: https://www.facebook.com/groups/genesiswp/permalink/2358845040833346/
Author: Damien Carbery
Version: 0.1
*/
add_action( 'woocommerce_before_single_product_summary', 'dcwd_add_wc_structured_data' );
@dexit
dexit / post_excerpt.php
Created July 2, 2025 16:18 — forked from jdevalk/post_excerpt.php
If you have the YouTube code in your post excerpt, this will fix it.
<?php
function fix_content_input( $content, $vid ) {
$post = get_post( $vid['post_id'] );
if ( !empty( $post->post_excerpt ) ) {
$content = "\n" . 'http://youtube.com/v/'. $post->post_excerpt . "\n" . $content;
}
return $content;
}
add_filter( 'wpseo_video_index_content', 'fix_content_input', 10, 2 );
@dexit
dexit / archive-wpseo_locations.php
Created July 2, 2025 16:17 — forked from jdevalk/archive-wpseo_locations.php
Easily create a custom post type archive page such as demoed on [the Yoast Local SEO demo site](http://local.yoastdemo.com/locations/) using this file:
<?php
/** Replace the standard loop with our custom Locations loop */
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'wpseo_locations_archive_loop' );
function wpseo_locations_archive_loop() {
echo '<h1>Locations</h1>';
echo '<div class="entry-content"><p>Your intro text here.</p></div>';
$args = array(