Skip to content

Instantly share code, notes, and snippets.

View mmarj's full-sized avatar
🏠
Working from home

MM Aurangajeb mmarj

🏠
Working from home
View GitHub Profile
@mmarj
mmarj / settings.json
Created December 4, 2022 16:27 — forked from HeyMehedi/settings.json
Basic WordPress Settings for VSCode
{
"code-runner.saveFileBeforeRun": true,
"workbench.colorTheme": "One Dark Pro",
"editor.fontSize": 16,
"phpfmt.psr2": false,
"phpfmt.passes": [
"PSR2KeywordsLowerCase",
"PSR2LnAfterNamespace",
"PSR2ModifierVisibilityStaticOrder",
"ReindentSwitchBlocks",
@mmarj
mmarj / yoast_seo_opengraph_change_image_size.php
Created August 19, 2022 17:48 — forked from amboutwe/yoast_seo_opengraph_change_image_size.php
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/
@mmarj
mmarj / functions.pnp
Created August 12, 2022 17:54 — forked from gmmedia/functions.php
Add featured image column to WP admin panel - posts AND pages
/**
* Add featured image column to WP admin panel - posts AND pages
* See: https://bloggerpilot.com/featured-image-admin/
*/
// Set thumbnail size
add_image_size( 'j0e_admin-featured-image', 60, 60, false );
// Add the posts and pages columns filter. Same function for both.
add_filter('manage_posts_columns', 'j0e_add_thumbnail_column', 2);
@mmarj
mmarj / url_upload.php
Created May 14, 2022 15:54 — forked from joviczarko/url_upload.php
Upload file from URL
<!DOCTYPE html>
<html>
<head>
<title>Upload file from URL</title>
<!-- From: https://stackoverflow.com/questions/22823204/is-there-any-way-to-upload-file-directly-from-url-in-filemanager-of-cpanel -->
</head>
<body>
<?php
$BASE_URL = strtok($_SERVER['REQUEST_URI'],'?');
@mmarj
mmarj / redirect-admin.php
Created May 14, 2022 15:54 — forked from devinsays/redirect-admin.php
Redirects subscribers back to the home page if they attempt to access the dashboard.
<?php
/**
* Redirects subscribers back to the home page if they attempt to access the dashboard.
*/
function prefix_redirect_admin() {
if ( ! current_user_can( 'edit_posts' ) && ! defined( 'DOING_AJAX' ) ) {
wp_safe_redirect( home_url() );
exit;
}
}
@mmarj
mmarj / wc-memberships-remove-my-memberships.php
Created February 5, 2022 21:52 — forked from bekarice/wc-memberships-remove-my-memberships.php
Remove "My Memberships" table on My Account with WooCommerce Memberships
<?php // Only copy this line if needed
/**
* Removes the "My Memberships" table from my account area
*/
function sv_remove_my_memberships_table() {
if ( function_exists( 'wc_memberships' ) && ! is_admin() ) {
remove_action( 'woocommerce_before_my_account', array( wc_memberships()->get_frontend_instance()->get_members_area_instance(), 'my_account_memberships' ) );
}
}
@mmarj
mmarj / terminal-cheat-sheet.txt
Created February 2, 2022 09:52 — forked from cferdinandi/terminal-cheat-sheet.txt
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
// ==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