This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This code base adds a custom media field named Image Credit. | |
| * | |
| * This example saves the value of the custom field on the media overlay | |
| * screen via ajax, as well as the media edit screen (non ajax). | |
| * | |
| * Added nonce check and sanitization. | |
| * | |
| * TO-DO - this custom functionality and the various hooks it's based on is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Script to Initialize my custom powershell setup. | |
| .DESCRIPTION | |
| Script uses scoop | |
| .NOTES | |
| **NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted. | |
| Author: Mike Pruett | |
| Date: October 18th, 2018 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*-------------------------------------------------------------- | |
| # Saving Features to Membership Levels from an acf repeater field for RCP Pro | |
| --------------------------------------------------------------*/ | |
| function some_feature_list( $level ) { | |
| /** | |
| * @var RCP_Levels $rcp_levels_db | |
| */ | |
| global $rcp_levels_db; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function wp_custom_excerpt_maxchar( $excerpt, $maxchar ) { | |
| // If $maxchar is numeric and its numeric value is a positive integer, echo the trimmed excerpt. | |
| // Otherwise return the untrimmed-but-stripped version. | |
| $excerpt = ( | |
| is_numeric( $maxchar ) && | |
| ( 0 < intval($maxchar) ) | |
| ) ? mb_substr( | |
| wp_strip_all_tags( $excerpt ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (() => { | |
| let count = 0; | |
| function getAllButtons() { | |
| return document.querySelectorAll('button.is-following') || []; | |
| } | |
| async function unfollowAll() { | |
| const buttons = getAllButtons(); | |
| for (let button of buttons) { | |
| count = count + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Filters the image quality for thumbnails to be at the highest ratio possible. | |
| * | |
| * Supports the new 'wp_editor_set_quality' filter added in WP 3.5. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param int $quality The default quality (90) | |
| * @return int $quality Amended quality (100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Helper function to slugify strings | |
| * ---------------------------------- | |
| * | |
| * @param string $text input string | |
| * @param string $divider divider character | |
| * @return string $text slugified string | |
| */ | |
| function slugify(string $text, string $divider = '-') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function($) { | |
| const removeConfirmation = function( $thisForm ) { | |
| console.log( $thisForm ); | |
| $thisForm.siblings('.gform_confirmation_wrapper').fadeOut(function() { | |
| $(this).remove(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Using jQuery to Detect When CSS3 Animations and Transitions End | |
| * @see https://blog.teamtreehouse.com/using-jquery-to-detect-when-css3-animations-and-transitions-end | |
| */ | |
| jQuery(document).ready(function($) { | |
| 'use strict'; | |
| const myButton = $('.my-button'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function keto_list_post_types() { | |
| $args = array( | |
| 'public' => true, | |
| '_builtin' => false | |
| ); | |
| $output = 'names'; // 'names' or 'objects' (default: 'names') |