TL;DR: I explain how to detect TLS 1.0 connections and, by way of custom headers, warn the user about the coming change to more modern TLS versions.
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 | |
/** | |
* Adding a custom filter | |
* A simple copy and paste of the existing Category filter | |
* Find this new filter in: WP Admin > Events > Settings > Filterbar | |
* Docs for TribeEventsFilter: http://docs.tri.be/Filter-Bar/class-TribeEventsFilter.html | |
*/ | |
class TribeEventsFilter_CustomClubs extends TribeEventsFilter { | |
public $type = 'select'; |
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 add_child_and_parent_to_acf_taxonomy_choices($choices) { | |
$tax_choices = array(); | |
foreach($choices as $taxonomy => $c) { | |
$tax_choices[$taxonomy] = $c; | |
if($taxonomy != 'all' && is_taxonomy_hierarchical($taxonomy)) { | |
$tax_choices[$taxonomy.'-tax_parent'] = $c.' (parent)'; | |
$tax_choices[$taxonomy.'-tax_child'] = $c.' (child)'; | |
} |
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
$ wp post list --format=ids | xargs wp post update --comment_status=closed | |
# Output: | |
# Success: Updated post 2514. | |
# Success: Updated post 2511. | |
# Success: Updated post 2504. | |
# Success: Updated post 2499. | |
# Success: Updated post 2441. | |
# etc... |
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 my_rest_prepare_post( $data, $post, $request ) { | |
$_data = $data->data; | |
$thumbnail_id = get_post_thumbnail_id( $post->ID ); | |
$thumbnail = wp_get_attachment_image_src( $thumbnail_id ); | |
$_data['featured_image_thumbnail_url'] = $thumbnail[0]; | |
$data->data = $_data; |
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 if (!defined('ABSPATH')) die('Restricted Area'); | |
/* | |
* Plugin Name: Disable Yoast SEO Notifications | |
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices. | |
* Version: 1.1 | |
* Author: Aurélien Denis | |
* Author URI: https://wpchannel.com/ | |
*/ |
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
//The following section is an add-on to this tutorial - https://tri.be/gravity-forms-events-calendar-submissions/ | |
//Shout to CreativeSlice.com for their initial work | |
/* Before Starting: | |
- Make sure you have these three plugins installed | |
- Gravity Forms | |
- The Events Calendar | |
- Gravity Forms + Custom Post Types | |
- Once Gravity Forms is installed, create a form with these fields | |
- Single Line Text (Event Title) | |
- Paragraph Text (Event Description) |
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
function bidirectional_acf_update_value( $value, $post_id, $field ) { | |
// vars | |
$field_name = $field['name']; | |
$global_name = 'is_updating_' . $field_name; | |
// bail early if this filter was triggered from the update_field() function called within the loop below | |
// - this prevents an inifinte loop | |
if( !empty($GLOBALS[ $global_name ]) ) return $value; |
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
/** | |
* Add the field "spaceship" to REST API responses for posts read and write | |
*/ | |
add_action( 'rest_api_init', 'slug_register_spaceship' ); | |
function slug_register_spaceship() { | |
register_rest_field( 'post', | |
'starship', | |
array( | |
'get_callback' => 'slug_get_spaceship', | |
'update_callback' => 'slug_update_spaceship', |
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 | |
/** | |
* Enqueue scripts and styles. | |
* | |
* @since 1.0.0 | |
*/ | |
function ja_global_enqueues() { | |
wp_enqueue_style( | |
'jquery-auto-complete', |