Skip to content

Instantly share code, notes, and snippets.

@BrElio
BrElio / searchwp-customizations.php
Created April 19, 2022 14:52 — forked from jchristopher/searchwp-customizations.php
Sort SearchWP WP_Post Results alphabetically by Title in ascending order
<?php
// Sort SearchWP WP_Post Results alphabetically by Title in ascending order.
add_filter( 'searchwp\query\mods', function( $mods ) {
$mod = new \SearchWP\Mod( \SearchWP\Utils::get_post_type_source_name( 'post' ) );
$mod->order_by( function( $mod ) {
return $mod->get_local_table_alias() . '.post_title';
}, 'ASC', 9 );
$mods[] = $mod;
@BrElio
BrElio / searchwp-customizations.php
Created August 23, 2022 11:08 — forked from jchristopher/searchwp-customizations.php
Enable full wpDataTables table Shortcode parsing when SearchWP indexer is running
<?php
// wpDataTables compatibility with SearchWP. Retrieve entire data table
// if the indexer is running (regardless of wpDataTables settings) to ensure
// all wpDataTables Shortcode content is indexed when parsing Shortcodes.
add_filter( 'wpdatatables_filter_table_metadata', function( $data, $table_id ) {
if ( did_action( 'searchwp\indexer\batch' ) ) {
$data->pagination = false;
$data->showAllRows = true;
$data->server_side = false;
@BrElio
BrElio / searchwp_removearabic.php
Last active July 22, 2025 09:35 — forked from gerald-drissner/searchwp_removearabic.php
Removes all kind of Arabic diacritical signs and markers and replaces them with their plain letter form. For the use of SearchWP Wordpress plugin.
<?php
/*
Plugin Name: SearchWP Remove Arabic Diacritics
Description: Removes all kind of إعراب-signs as well as تشكيل-signs for the use of SearchWP Wordpress plugin.
Author: Gerald Drissner
Note: This is a fork and extension of https://gist.github.com/BrElio/bd84d8035278adf834b29ec5e1187567 and Relevannsi's code snippet regarding foreign languages.
Version: 1.0.0
Last update: 2022-10-20
*/