View WP-custom_allowed_blocks.php
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 /* Remove all blocks from the theme category */ | |
function custom_allowed_block_types ( $allowed_block_types, $block_editor_context ) { | |
$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered(); | |
if (!empty($block_types)) { | |
$allowed_block_types = array(); | |
foreach ($block_types as $key => $value) { | |
if ($value->category != 'theme') { | |
$allowed_block_types[] = $key; |
View tribe_get_events_with_ongoing_events.php
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 // Retrieve all events (with ongoing events) in October 2019 | |
$events = tribe_get_events( [ | |
'eventDisplay' => 'custom', | |
'ends_after' => '2019-10-01 00:01', | |
'starts_before' => '2019-10-31 23:59', | |
] ); |
View stars-block.js
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( blocks, element ) { | |
var el = element.createElement; | |
function Stars( { stars } ) { | |
return el( 'div', { key: 'stars' }, | |
'★'.repeat( stars ), | |
( ( stars * 2 ) % 2 ) ? '½' : '' ); | |
} | |
blocks.registerBlockType( 'stars/stars-block', { |
View tribe_remove_archive_ical_links.php
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 | |
/** | |
* Removes the iCal and Google cal links from archive pages | |
*/ | |
function tribe_remove_calendar_export_links() { | |
if ( function_exists( 'tribe' ) ) { | |
remove_action( 'tribe_events_after_footer', array( tribe( 'tec.iCal' ), 'maybe_add_link' ) ); | |
} | |
} |
View tribe_remove_single_calendar_links.php
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 | |
/** | |
* Removes the iCal and Google cal links from the single event page | |
*/ | |
function tribe_remove_single_calendar_links() { | |
if ( function_exists( 'tribe' ) ) { | |
remove_action( 'tribe_events_single_event_after_the_content', array( tribe( 'tec.iCal' ), 'single_event_links' ) ); | |
} | |
} |
View WP-custom_rest_api.php
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
// Init REST Route | |
function register_custom_api_hooks() { | |
$namespace = 'custom-name/v1'; | |
register_rest_route( $namespace, '/posts/', array( | |
'methods' => 'GET', | |
'callback' => 'custom_api_get_posts', | |
) ); | |
} | |
add_action( 'rest_api_init', 'register_custom_api_hooks' ); |
View WP-custom_cron.php
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 your_function(){ | |
// **** Add your function here **** | |
} | |
add_action( 'your_cron_action', 'your_function' ); | |
// Init Cron Job | |
function init_custom_cron() { | |
if( !wp_next_scheduled( 'your_cron_action' ) ){ | |
wp_schedule_event( time(), '20min', 'your_cron_action' ); | |
} |
View WP-custom_embed_header.php
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 goyippi_embed_header() { | |
wp_deregister_style('open-sans'); | |
wp_enqueue_style( 'goyippi-embed-font', 'http://fonts.googleapis.com/css?family=Droid+Sans:400,700','','', 'all' ); | |
wp_enqueue_style( 'goyippi-embed-styles', get_bloginfo('stylesheet_directory').'/wp-style_embed.css','','', 'all' ); | |
} | |
add_action( 'embed_head', 'goyippi_embed_header' ); |
NewerOlder