Skip to content

Instantly share code, notes, and snippets.

Tim Carr n7studios

View GitHub Profile
@n7studios
n7studios / wp-to-buffer-modify-excerpt.php
Created Apr 11, 2019
WordPress to Buffer: Modify Excerpt in Status
View wp-to-buffer-modify-excerpt.php
<?php
/**
* Plugin Name: WP to Buffer: Modify Excerpt in Status
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Modify the {excerpt} output, immediately before it is sent to Buffer.
*/
@n7studios
n7studios / custom-fields-meta-keys.php
Created Mar 4, 2019
Custom Fields Meta Box: Define Meta Keys for Performance
View custom-fields-meta-keys.php
<?php
/**
* Plugin Name: Custom Fields Meta Box: Define Meta Keys for Performance
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Explicitly define the Meta Keys to display in the Custom Fields > Add New Custom Field > Name <select> dropdown, to save WordPress performing a potentially expensive and slow query.
*/
@n7studios
n7studios / page-generator-pro-tablepress.php
Created Feb 20, 2019
Page Generator Pro: TablePress Example Integration
View page-generator-pro-tablepress.php
<?php
/**
* Plugin Name: Page Generator Pro: TablePress Example Integration
* Plugin URI: http://www.wpzinc.com/plugins/page-generator-pro
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Example integration of how keywords within a third party Plugin, that uses a shortcode within a Page Generator Pro 1.9.8+ Content Group can be processed.
*/
@n7studios
n7studios / post-to-social.php
Last active Feb 3, 2019
Determine Post Publish / Update via Classic Editor, Gutenberg and REST API
View post-to-social.php
<?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 / acf-blocks.php
Created Dec 14, 2018
Advanced Custom Fields: Registering Custom Gutenberg Blocks
View acf-blocks.php
<?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+
*/
@n7studios
n7studios / zoopla.htm
Created Sep 4, 2018
zoopla-average-property-values-postcode-failure.htm
View zoopla.htm
<!DOCTYPE html>
<html>
<head>
<title>Zoopla Average House Price Widget: Outcode Error</title>
</head>
<body>
<!--
Steps to produce the below code:
1. Visit https://www.zoopla.co.uk/useful-tools/widgets/values/
View page-generator-pro-enable-meta-boxes.php
<?php
/**
* Plugin Name: Page Generator Pro: Enable Meta Boxes
* Plugin URI: http://www.wpzinc.com/plugins/page-generator-pro
* Version: 1.0.0
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Demonstrates how to enable custom and/or third party plugin meta boxes on Page Generator Pro Groups. See: https://www.wpzinc.com/documentation/page-generator-pro/developers-enable-meta-boxes/
*/
@n7studios
n7studios / wp-to-buffer-pro-change-url.php
Created Dec 13, 2017
WordPress to Buffer Pro: Change value of {url}
View wp-to-buffer-pro-change-url.php
<?php
/**
* Plugin Name: WP to Buffer Pro: Change URL
* Plugin URI: http://www.wpzinc.com/plugins/wp-to-buffer-pro
* Version: 1.0.0
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Changes the {url} from your Post's URL to something else. Change code in this Plugin as necessary to define the URL you want.
*/
View comment-rating-field-pro-plugin-output-comment-sorting-dropdown.php
<?php
/**
* For developers and themes which do not make use of the WordPress wp_list_comments() function,
* the below code can be added to output the dropdown options for sorting comments by rating.
*
* There must be a Field Group configured at Comment Rating Field Pro > Field Groups to display
* rating fields for the Post Type the visitor is viewing.
*/
if ( function_exists( 'output_comment_sorting_dropdown' ) ) {
output_comment_sorting_dropdown( $post_id, $output_style );
View comment-rating-field-pro-plugin-get-posts-sorted-by-rating.php
<?php
/**
* For developers who wish to get an array of Posts ordered by rating, highest to lowest, the
* below code can be used.
*
* @param array $args WP_Query compatible arguments
*/
if ( function_exists( 'get_posts_ordered_by_rating' ) ) {
$posts = get_posts_ordered_by_rating( array(
'post_type' => 'post',
You can’t perform that action at this time.