Skip to content

Instantly share code, notes, and snippets.

View mmarj's full-sized avatar
🏠
Spreading H@ppiness!!

MM Aurangajeb mmarj

🏠
Spreading H@ppiness!!
View GitHub Profile
// ==UserScript==
// @name Dupe review helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Watches out for reviews made by the same IP subnet
// @author anevins12
// @match https://wordpress.org/support/topic/*
// @grant none
// ==/UserScript==
@mmarj
mmarj / functions.php
Created January 17, 2022 19:55 — forked from alexander-young/functions.php
WP Basic Cleanup
<?php
// //remove emoji support
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
// // Remove rss feed links
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
@mmarj
mmarj / dokan_thank_you_order_received_text_modified
Created December 9, 2021 23:10 — forked from alamgircsebd/dokan_thank_you_order_received_text_modified
Thank you message modified to vendor info on order received page
// How Use => Add this scripts on your theme functions.php file
// Output => https://prnt.sc/y4ljek
/**
* Thank you message modified to vendor info on order received page
*
* @param string $thank_you_title
* @param obj $order
@mmarj
mmarj / functions.php
Created October 27, 2021 14:05 — forked from vovafeldman/functions.php
Freemius - weDocs Permalinks
<?php
/**
* Customize docs permalinks parsing.
*
* @author Vova Feldman
*/
function freemius_docs_permastruct_rewrite() {
if ( post_type_exists( 'docs' ) ) {
// Modify root slug to "help" instead of docs.
@mmarj
mmarj / _sections-header.scss
Created October 27, 2021 14:01 — forked from vovafeldman/_sections-header.scss
Freemius - weDocs Pretty Sections
// Header search
.page-header
{
.wedocs-search-form
{
position: relative;
input
{
@include placeholder(#999);
@mmarj
mmarj / functions.php
Created August 25, 2021 18:39 — forked from danjjohnson/functions.php
WPJM: Limit file upload size
<?php
function limit_upload_size_limit_for_non_admin( $limit ) {
if ( ! current_user_can( 'manage_options' ) ) {
$limit = 1000000; // 1mb in bytes
}
return $limit;
}
add_filter( 'upload_size_limit', 'limit_upload_size_limit_for_non_admin' );
@mmarj
mmarj / .htaccess
Created July 7, 2021 14:39 — forked from ShiponKarmakar/.htaccess
Most Useful and Helpful .htaccess Code
#stop directory browsing
Options All -Indexes
# SSL Https active Force non-www
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@mmarj
mmarj / functions.php
Created July 6, 2021 16:25 — forked from tareq1988/functions.php
Dokan seller info in popup on store page
<?php
add_action( 'wp_enqueue_scripts', function() {
if ( ! dokan_is_store_page() ) {
return;
}
wp_enqueue_style('dokan-magnific-popup');
wp_enqueue_script('dokan-popup');
} );
@mmarj
mmarj / add-ajax-extended.php
Created May 11, 2021 18:46 — forked from obiPlabon/add-ajax-extended.php
Register ajax action hook.
<?php
/**
* Register ajax action hook.
*
* When you have lots of ajax actions in your theme or plugin then
* this utility function is going to be quite handy!
* By default all actions are for logged in users.
*
* Usage:
* add_ajax( 'get_infinity_posts', 'prefix_get_infinity_posts' ); // for logged in only
@mmarj
mmarj / gettext-filter-multiple.php
Created February 20, 2021 20:16 — forked from BFTrick/gettext-filter-multiple.php
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );