Skip to content

Instantly share code, notes, and snippets.

View n7studios's full-sized avatar

Tim Carr n7studios

View GitHub Profile
@n7studios
n7studios / post-to-social.php
Last active March 9, 2024 10:47
Determine Post Publish / Update via Classic Editor, Gutenberg and REST API
<?php
/**
* Example class implementation to perform actions, such as sending a Post
* to a third party API or service, when the Post is published or updated through:
* - Classic Editor
* - Gutenberg
* - REST API
*
* @package Post_To_Social
* @author Tim Carr
@n7studios
n7studios / gravity-forms-move-progress-bar-bottom.php
Created November 19, 2015 16:14
Gravity Forms - Move Progress Bar to Bottom of Form
<?php
/**
* Plugin Name: Gravity Forms: Move Progress Bar to Bottom of Form
* Plugin URI: http://www.n7studios.co.uk
* Version: 1.0.0
* Author: n7 Studios
* Author URI: http://www.n7studios.co.uk
* Description: Moves the progress bar from the top to the bottom of the Gravity Form. The Start Paging section of the form MUST have a CSS class = progress-bar-bottom
*/
@n7studios
n7studios / wp-dropdown-categories-aria-label.php
Last active November 23, 2023 21:55
WordPress: Add the aria-label attribute to wp_dropdown_categories(): https://www.n7studios.co.uk/adding-aria-labels-wp_dropdown_categories/
<?php
/**
* If the aria-label argument has been specified in a wp_dropdown_categories() call,
* output the aria-label option in the <select>
*
* @since 1.0.0
*
* @param string $output HTML Output
* @param array $arguments wp_dropdown_category() arguments
* @return string Modified HTML Output
@n7studios
n7studios / wp-to-buffer-pro-custom-image.php
Last active May 30, 2023 12:49
WordPress to Buffer Pro: Programmatically specify status image(s)
<?php
/**
* Plugin Name: WP to Buffer Pro: Custom Image for Status
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Define a custom image for a status programmatically
*/
@n7studios
n7studios / acf-blocks.php
Created December 14, 2018 16:01
Advanced Custom Fields: Registering Custom Gutenberg Blocks
<?php
/**
* Plugin Name: Advanced Custom Fields: Gutenberg Blocks
* Plugin URI: https://www.n7studios.co.uk
* Version: 1.0.0
* Author: n7 Studios
* Author URI: https://www.n7studios.co.uk
* Description: Example code to register Advanced Custom Field Groups as Blocks. Requires ACF 5.8+
*/
<?php
/**
* Adds a title attribute to iframe oembeds
*
* @since 1.0.0
*
* @param string $html HTML
* @param string $url URL to embed
* @param array $attributes HTML Attributes
* @param int $post_id Post ID
@n7studios
n7studios / wp-to-buffer-pro-convert-paragraphs-to-breaklines.php
Created February 29, 2020 13:18
WordPress to Buffer Pro: Convert Paragraphs to Breaklines
<?php
/**
* Plugin Name: WP to Buffer Pro: Convert Paragraphs to Breaklines in Statuses
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Modify the {content} output by converting paragraphs to breaklines
*/
@n7studios
n7studios / tuts-crm.php
Created December 26, 2014 15:07
Tuts+ Create a Simple CRM in WordPress: Part 3
<?php
/**
* Plugin Name: Tuts+ CRM
* Plugin URI: #
* Version: 1.0
* Author: Tuts+
* Author URI: http://code.tutsplus.com
* Description: A simple CRM system for WordPress
* License: GPL2
*/
<?php
/**
* Plugin Name: WP to Buffer Pro: Remove URLs from Content and Excerpt Tags
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Remove URLs from Content and Excerpt Tags.
*/
@n7studios
n7studios / page-generator-pro-programmatically-process-spintax-block-spintax.php
Created June 22, 2021 18:48
Page Generator Pro: Programmatically Process Spintax and Block Spintax
<?php
/**
* Make sure to run this after WordPress' init hook has completed.
*/
function process_block_spintax_and_spintax_example( $text ) {
// Bail if Page Generator Pro isn't active
if ( ! function_exists( 'Page_Generator_Pro' ) ) {
return new WP_Error( 'error', __( 'Page Generator Pro not active.' ) );
}