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
@nathaningram
nathaningram / mu-dashwidgets.php
Last active November 22, 2024 21:25
Starter Site 2024 Course - MU Dashboard Widgets
<?php
/*
Plugin Name: Custom Dashboard Widgets
Plugin URI: https://wpnathan.com
Description: Creates Custom Dashboard Widgets for Client Websites
Version: 2024.11
Author: Nathan Ingram
Author URI: https://wpnathan.com
License: GPL2
*/
// Add a custom function to create the meta box
add_action('add_meta_boxes', 'add_shortcodes_metabox');
// Function to add the meta box to the post edit screen
function add_shortcodes_metabox() {
add_meta_box(
'shortcodes-metabox', // Unique ID for the meta box
'Available Shortcodes', // Title of the meta box
'display_shortcodes', // Callback to display the meta box content
'post', // Screen (post type) where the meta box will be displayed
@MaximilianoRicoTabo
MaximilianoRicoTabo / add-custom-user-field-to-track.php
Created January 10, 2024 21:03
Capture User Fields as User Properties For Reporting in Google Analytics Integration Add On
<?php
/**
* Capture User Fields as User Properties For Reporting in Google Analytics Integration Add On
* title: Capture User Fields as User Properties For Reporting in Google Analytics Integration Add On
* layout: snippet
* collection: add-ons, pmpro-google-analytics
* category: users, custom user fields
* link: TBD
*
* You can add this recipe to your site by creating a custom plugin
@esedic
esedic / wp_comments.php
Created November 2, 2023 10:20
Disable WordPress comments
<?php
/***********************************
*
* ! DISABLE COMMENTS
*
* *********************************/
function df_disable_comments_post_types_support()
{
@BAProductions
BAProductions / SwiftUIWebView.swift
Last active April 4, 2023 12:41
SwiftUI Wrapper WKWebView works, But still think it can be better optmize if anyone wants optmize better feel free to do so.
//
// webview.swift
// BR
//
// Created by BAproductions on 8/12/22.
//
import SwiftUI
import WebKit
import Combine
import SwiftUI
struct ContentView: View {
let svgURL = URL(string: "URL TO YOUR SVG")!
var body: some View {
WebView(url: svgURL)
}
}
@boraseoksoon
boraseoksoon / MonacoWebView.swift
Created March 5, 2023 08:40
Load Monaco editor in a single html file for MacOS SwiftUI
import SwiftUI
import WebKit
@main
struct MonacoApp: App {
let codeSnippet = """
var body: some Scene {
WindowGroup {
EditorView(content: codeSnippet, language: "swift", theme: "vs-dark")
}
@moto0000
moto0000 / AsyncImage.swift
Last active June 22, 2024 02:13
Mockable SwiftUI.AsyncImage
import SwiftUI
public struct AsyncImage<Content>: View where Content: View {
private var content: (ImageProvider) -> _ConditionalContent<
SwiftUI.AsyncImage<Content>, Content
>
@Environment(\.imageProvider) var imageProvider
public init(
@epierpont
epierpont / block-examples.php
Created January 27, 2023 20:51
block examples
<?php
/**
* The blocks class file.
*
* @package WordPress
* @subpackage Swift_News_Theme
*/
namespace Swift;
@endurtech
endurtech / disable-wordpress-commenting.php
Last active February 21, 2025 18:21
The following snippets should help you disable commenting within WordPress.
<?php
// Disable Commenting in WordPress
// https://endurtech.com/how-to-completely-disable-comments-in-wordpress/
add_action( 'admin_init', function ()
{
// Redirect any user trying to access comments page
global $pagenow;
if ( $pagenow === 'edit-comments.php' )