This file contains 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 | |
/* | |
Plugin Name: WPF All Sites | |
Plugin URI: verygoodplugins.com | |
Description: Stores log of all sites that call home looking for updates | |
Version: 1.0 | |
Author: vergoodplugins | |
Author URI: verygoodplugins.com | |
License: |
This file contains 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
// ==UserScript== | |
// @name Inline Code Styling - basecamp.com | |
// @namespace Violentmonkey Scripts | |
// @match https://*.basecamp.com/* | |
// @grant GM_addStyle | |
// @version 1.0 | |
// @author - | |
// @description 3/29/2023, 12:42:11 PM | |
// ==/UserScript== |
This file contains 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 | |
/** | |
* Assumptions: | |
* - Form ID is #28 | |
* - Page ID is 406200 | |
* - Fields include radio for reason & extra details where needed. | |
*/ |
This file contains 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
// Get ACF value whetherit comes from regular ACF or ACF block | |
// Useful if you need to access ACF fileds that are in block as regular fields | |
// Usage: get_acf_block_data($post, 'acf/talk-description', 'talk_description' ) | |
function get_acf_block_data($post, $block_name = 'acf/default-block-name', $field_name = "" ){ | |
$content = ""; | |
if ( has_blocks( $post->post_content ) && !empty($field_name )) { | |
$blocks = parse_blocks( $post->post_content ); | |
foreach($blocks as $block){ | |
if ( $block['blockName'] === $block_name ) { | |
if(isset($block["attrs"]["data"][$field_name ])){ |
This file contains 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 | |
/** | |
* Register some default block editor styles for this block. | |
*/ | |
function hd_register_block_styles() { | |
// add the small image style. | |
register_block_style( | |
'core/heading', // name of your block | |
array( |
This file contains 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
$items = [1, 2, 3, 4]; | |
$itemToDelete = 3; | |
$itemsWithout3 = array_values(array_diff($items, [$itemToDelete])); | |
//$itemsWithout3 => [1, 2, 4] |
This file contains 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
add_filter( 'acf/get_valid_field', 'change_post_content_type'); | |
function change_post_content_type( $field ) { | |
if($field['type'] == 'wysiwyg') { | |
$field['tabs'] = 'visual'; $field['toolbar'] = 'basic'; $field['media_upload'] = 0; | |
} | |
return $field; } |
This file contains 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
(function($) { | |
$.fn.fSelect = function(options) { | |
if ('string' === typeof options) { | |
var settings = options; | |
} | |
else { | |
var settings = $.extend({ | |
placeholder: 'Select some options', |
This file contains 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 | |
/* | |
Plugin Name: GF file upload to ACF image field | |
Plugin URI: https://gist.github.com/certainlyakey/8c19791b3133beb62d323bf060bf4270 | |
Description: Map Gravity forms file upload field to ACF image/file field so GF would upload the file and save id to DB instead of URL. | |
Version: 1.0.0 | |
Author: Kellen Mace | |
*/ |
This file contains 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 | |
/** | |
* Plugin Name: Convert ACF PHP to JSON | |
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON. | |
*/ | |
namespace ConvertAcfPhpToJson; | |
/** | |
* Add submenu item under 'Custom Fields' |
NewerOlder