Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
@dexit
dexit / functions.php
Created July 7, 2025 16:26 — forked from YahyaTec/functions.php
add in child theme
if ( ! function_exists( 'electro_premium_templates_path' ) ) {
/**
* emart Elementor Template function
*
* @param string $path elementor template path.
*/
function electro_premium_templates_path( $path ) {
$path = 'https://electro.madrasthemes.com/4x/';
return $path;
@dexit
dexit / snippets.php
Created July 7, 2025 16:01 — forked from TomislavBombas/snippets.php
Various PHP snippets #php #arrays
<?php
// parse multidimensional arrays
function parseArray($arr, $ind = "") {
$indent = "&nbsp;&nbsp;&nbsp;&nbsp;";
foreach($arr as $key => $value)
{
if (!is_array($value)) {
print_r($ind . $key . ": " . $value . '<br/> ');
} else {
print_r($ind . $key . ": <br/>");
<?php
use Elementor\Core\DynamicTags\Tag;
class Custom_Meta_Fields_Tag extends \Elementor\Core\DynamicTags\Tag {
public function get_name() {
return 'custom-meta-fields';
}
{
"exportFormatVersion": 2,
"exportTime": "2024-10-23 06:16:01",
"containerVersion": {
"path": "accounts/6250428815/containers/195873904/versions/4",
"accountId": "6250428815",
"containerId": "195873904",
"containerVersionId": "4",
"container": {
"path": "accounts/6250428815/containers/195873904",
@dexit
dexit / functions.php
Created July 7, 2025 15:59 — forked from victorocna/functions.php
Speed up Wordpress
/**
* Disable the Gutenberg’s CSS loading on the front-end
*/
function tw_unload_files() {
wp_dequeue_style ( 'wp-block-library' );
wp_dequeue_style ( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 );
/**
@dexit
dexit / yourls-custom-url-parameters.php
Created July 7, 2025 15:59 — forked from jemoreto/yourls-custom-url-parameters.php
YOURLS Custom URL Parameters - Manages long link exit URL parameters
<?php
/*
Plugin Name: WP Boss - YOURLS Custom URL Parameters
Plugin URI: https://www.wpboss.com.br/
Description: Manages long link exit URL parameters
Version: 1.0
Author: John (João Elton Moreto)
Author URI: https://www.wpboss.com.br/
This plugin is based on "Google Analytics" plugin, by Katz Web Services, Inc. Reference link: http://katz.co/yourls-analytics/
@dexit
dexit / term-meta.php
Created July 7, 2025 15:53 — forked from chrisdc/term-meta.php
Add a custom meta box to the new/edit category pages. The meta data is saved to the array term_meta[], which can handle further fields in the future. Based on: https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/
<?php
/**
* Add a custom meta box to the new/edit category pages.
* The meta data is saved to the array term_meta[], which can handle further
* fields in the future.
*
* Based on: https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/
*/
/**
@dexit
dexit / elementor-custom-templates.php
Created July 7, 2025 10:32 — forked from bainternet/elementor-custom-templates.php
You can show *your* page templates in the predesigned templates area with screenshots
<?php
/**
* Elementor get the local templates via a CPT query and use a filter to let us change the template data
* https://github.com/pojome/elementor/blob/master/includes/template-library/sources/local.php#L202
* In ouy theme or plugin we can hook that filter as follow
*
* This filter change the source only for the *page* template type to show it in the main tab
* @see https://cl.ly/1z2Y1n2x0K0F
**/
@dexit
dexit / add.php
Created July 7, 2025 10:26 — forked from igorbenic/add.php
How to Add Custom Fields to WordPress Taxonomies | http://www.ibenic.com/custom-fields-wordpress-taxonomies
<?php
do_action( "{$taxonomy}_add_form_fields", string $taxonomy );
<?php
class WordPress_Custom_Status {
/**
* Post Types for this status
* @var array
*/
protected $post_type = array();