Skip to content

Instantly share code, notes, and snippets.

<?php
// Nav Menu Dropdown Class
include_once( CHILD_DIR . '/lib/classes/nav-menu-dropdown.php' );
/**
* Mobile Menu
*
*/
function be_mobile_menu() {

CMB2 Canned Issue Response

Unfortunately, we can't support every person's specific or custom implementations for CMB2. Github issues are reserved for confirmed bug reports and occasional feature requests. Please review the CONTRIBUTING.md for support suggestions. Please also review the additional resources listed at the bottom of that document, as the solution you're looking for may already be present.

CMB2 Taxonomy field canned response

The taxonomy fields are not intended to provide an arbitrary list of terms to pick from, but are intended to be a replacement for the default taxonomy metaboxes. I.e. they are meant to set the taxonomy terms on an object. Any other use of these types will be hacky and/or buggy. I suggest looking at building a custom field type for this: https://github.com/WebDevStudios/CMB2/wiki/Tips-&-Tricks#a-dropdown-for-taxonomy-terms-which-does-not-set-the-term-on-the-post

CMB2 wrong PR response

Thank you for

UsedByTeams Model Trait For Laravel Spark

Automatically limit your models to the current team

So you're using spark, and you have teams enabled. You start creating models and want to have them be team specific. Instead of writing, Model::where('team_id', auth()->user()->currentTeam->id)->get(); use this trait to add that behind the scenes so that every time you call on your model, it's assumed that you mean for the current team.

This assumes that the model has a team_id, while it adds a scope of where team_id = currentTeam->id.

Note: Implicit Route Model Binding in 5.2, auth session doesn't exist at the point of this trait causing issue. fixed in 5.3

@tnorthcutt
tnorthcutt / rm_mysql.md
Created April 24, 2019 14:52 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

<?php
// ConvertKit API Key:
$convertkitApiKey = 'your-convertkit-api-key';
// Map each of your Clickbank products to a ConvertKit tag ID, or leave this array empty to
// use the default tag for all products:
$convertkitTags = array(
'clickbankproduct1' => 'cktag1',
'clickbankproduct2' => 'cktag2',
'clickbankproduct3' => 'cktag3',
);
@tnorthcutt
tnorthcutt / index.php
Last active September 7, 2020 15:33 — forked from vsoch/index.php
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
<?php
header('Content-type: text/xml');
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
$feedName = "Name";
$feedDesc = "Description";