Skip to content

Instantly share code, notes, and snippets.

View BAProductions's full-sized avatar
💭
Making Test Build With Imported Repo

DJABHipHop BAProductions

💭
Making Test Build With Imported Repo
View GitHub Profile
<?php
/*
Plugin Name: Delete all comments
Description: A custom plugin for deleting all comments from a WordPress site.
Version: 1.0
Author: Your Name
*/
/*
ChatGPT prompt:
@mbrughi
mbrughi / functions.php
Created November 7, 2022 13:42
Wordpress: Check if plugin is active (various examples) (NB: do not copy the entire code but only the necessary snippet )
<?php
/**
* Detect if a WordPress plugin is active
* (various examples)
*/
/* When coding plugins that rely on another one, like Private Content for bbPress or Visual Attributes for WooCommerce,
you need to make if the WordPress Plugin is active to initialize your plugin routines or display a notice saying that
the required plugin must be activated. In this tutorial we’ll see how to detect whether a certain plugin is active in a
couple of ways.
@zentrope
zentrope / RichTextEditor.swift
Created October 2, 2022 00:00
NSTextView wrapper for SwiftUI
import Combine
import SwiftUI
struct RichTextEditor: NSViewRepresentable {
@Binding var attributedText: NSAttributedString
@Binding var showInspector: Bool
var activity: PassthroughSubject<Date, Never>
@jonathanstegall
jonathanstegall / reset-metabox-order.php
Created September 19, 2022 14:30
Allow WordPress users to reset the metabox order for the post edit screen.
<?php
/*
Plugin Name: Reset Metabox Order
Description: Allow WordPress users to reset the metabox order for the post edit screen.
Version: 0.0.1
Author: Jonathan Stegall
Author URI: https://code.minnpost.com
Text Domain: reset-metabox-order
License: GPL2+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@melek
melek / optional-force-sells.php
Last active November 9, 2024 00:51
An extension for WooCommerce Force Sells which lets a merchant make force sells optional on a product.
<?php
/**
* Plugin Name: Optional Force Sells
* Plugin URI: https://gist.github.com/melek/594d80882b4e0199a18a0c5df5baf3c7
* Description: Extends WooCommerce Force Sells by allowing force sells on a product to be optional on the single product page.
* Version: 0.1.5
* Author: Lionel Di Giacomo
* Author URI: https://github.com/melek
* License: GPL 2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@Julli4n
Julli4n / ok.js
Last active April 25, 2025 21:29
ROBLOX
/*
!! The feature that uses this endpoint has recently started rolling out to users.
!! See `App > Avatar > Profile Picture Editor`
!!
!! You may continue using this script, the only advantage is being able to
!! customize FullBody and Closeup independently.
*/
//
// WebView.swift
// OPass
//
// Created by secminhr on 2022/6/23.
// 2022 OPass.
//
import SwiftUI
import Combine
@paolo-mnet
paolo-mnet / wordpress-snippets.php
Last active November 9, 2024 00:46
A collection of WordPress snippets
<?php
// functions.php
/**
* Remove language dropdown from WordPress Admin login screen.
*/
add_filter('login_display_language_dropdown', '__return_false');
/**
* Disable XML-RPC by default.
@petenelson
petenelson / hide-meta-boxes.php
Last active April 25, 2025 13:59
WordPress: Hide specific post editing meta boxes
<?php
$this->_add_action( 'current_screen', 'maybe_hide_meta_boxes' );
/**
* Hides various meta boxes if they have not already been hidden.
* Users can still unhide the meta box and it will not be hidden in
* the future.
*
* @param WP_Screen $screen The current screen object.
@hkitago
hkitago / ContentView.swift
Last active March 30, 2023 17:26
WKWebViewTemplate to display HTML with JavaScript
//
// ContentView.swift
// WKWebViewTemplate
//
// Created by Hiroyuki KITAGO on 2022/01/26.
//
import SwiftUI
import WebKit
struct ContentView: View {