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
wp.domReady( function() { | |
//wp.blocks.getBlockTypes().forEach( function( blockType ){ console.log( blockType.name ); }); | |
var core_variations = [ | |
'core/archives', | |
'core/audio', | |
'core/avatar', | |
'core/block', | |
'core/block', |
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
$countries = array( | |
'Afghanistan' => 'Afghanistan', | |
'Albania' => 'Albania', | |
'Algeria' => 'Algeria', | |
'American Samoa' => 'American Samoa', | |
'Andorra' => 'Andorra', | |
'Angola' => 'Angola', | |
'Anguilla' => 'Anguilla', | |
'Antarctica' => 'Antarctica', | |
'Antigua and Barbuda' => 'Antigua and Barbuda', |
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
'use strict' | |
const puzzle = { | |
init: function (start) { | |
const nextBtn = document.getElementById('next'); | |
nextBtn.dataset.current = start; | |
}, | |
shuffle: function () { | |
const puzzContainer = document.getElementById('puzzle-container'); | |
const nextBtn = document.getElementById('next'); |
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
WP_Rewrite Object | |
( | |
[permalink_structure] => /%postname%/ | |
[use_trailing_slashes] => 1 | |
[author_base] => author | |
[page_structure] => %pagename% | |
[search_base] => search | |
[comments_base] => comments | |
[pagination_base] => page | |
[comments_pagination_base] => comment-page |
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 | |
/** | |
* Proptotype | |
*/ | |
namespace DoggieRescue\Notices; | |
class AdminNotice { | |
public static function process_messages() { | |
$notice = self::get_admin_message(); | |
if ( ! empty( $notice ) && is_array( $notice ) ) { |
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
// Need to set the shortcut parameter in the post template where the gallery will be displayed. | |
[meow-gallery acf=1] | |
// Hook up to intercept the gallery shortcode and check for attribute. | |
add_filter( | |
'shortcode_atts_gallery', | |
function( $result, $defaults, $atts ) { | |
if ( 1== $atts['acf']) { // The ACF gallery MUST be set to return IDs for this to work! |
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 | |
/** | |
* Oxygen helper class to define when to display search results. | |
* | |
* @package scorpiotek-wordpress-utilities | |
*/ | |
namespace ScorpioTek\WPUtil\Oxygen; | |
class SearchAssist { |
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 | |
/** | |
* Modifies event listing. | |
* | |
* @package scorpiotek-wordpress-utilities | |
* | |
*/ | |
namespace ScorpioTek\WPUtil\Events; |
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 | |
function( $query ) use ( $custom_post_type_name ) { | |
if ( ! is_admin() && $query->is_main_query() ) { | |
if ( ! empty( $custom_post_type_name) && $query->is_post_type_archive( $custom_post_type_name ) ) { | |
$date_sydney_now = ( new \DateTime( 'now', new \DateTimeZone( 'Australia/Sydney' ) ) )->format('Ymd'); | |
/** Default to upcoming events. */ | |
$compare = '>='; | |
if ( 'true' === $_GET['archive'] ) { | |
/** We need to get everything older than today. */ |
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 | |
add_action( 'wp_login', 'wppb_toolbox_count_user_logins', 20, 2 ); | |
function wppb_toolbox_count_user_logins( $user_login, $user ) { | |
if ( empty($user->ID) ) return; | |
$now = new DateTime( 'now', wp_timezone() ); | |
update_user_meta( $user->ID, 'last_login_date', $now->format( 'Y-m-d H:i:s' ) ); | |
} |
NewerOlder