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
version: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- ./mysql:/var/lib/mysql | |
ports: | |
- "3306:3306" | |
restart: always |
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 | |
// List of countries: https://help.salesforce.com/s/articleView?id=000318281&type=1 | |
$countries = [ | |
'AF' => 'Afghanistan', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', |
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
# A set of files you probably don't want in your WordPress.org distribution | |
.deploy | |
.distignore | |
.DS_Store | |
.editorconfig | |
.git | |
.github | |
.gitignore | |
.gitmodules | |
*.sql |
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 | |
/** | |
* Plugin Name: Disable Email | |
* Plugin URI: https://www.tannerrecord.com/micro-plugins/disable-email | |
* Description: A plugin that disables all email sent using <code>wp_mail()</code>. | |
* Author: Tanner Record | |
* Author URI: https://www.tannerrecord.com | |
* Update URI: false | |
* Version: 1.0 | |
*/ |
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 get_vimeo_id( $url ) { | |
/** | |
* Matches: | |
* https://player.vimeo.com/video/123456789 | |
* https://vimeo.com/123456789 | |
* https://www.vimeo.com/123456789 | |
*/ | |
preg_match( '/(vimeo\.com\/)(?:video\/)?([\d]+)/', $url, $matches ); | |
$vimeo_id = $matches[2]; |
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
/** | |
* Gets the top most ancestor for a post. | |
* | |
* @param object $post The current post | |
* | |
* @return integer The post ID of the ancestor | |
*/ | |
function get_top_ancestor( $post ) { | |
if ( $post->post_parent ) { | |
$ancestors = get_post_ancestors( $post->ID ); |
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 | |
/** | |
* Redirect all attachment pages to actual file | |
*/ | |
function redirect_attachment_pages() { | |
global $post; | |
// Return if not an attachment | |
if ( !is_attachment() ) { |
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 | |
/** | |
* functions.php | |
**/ | |
add_filter( 'siwg_auth_redirect', 'redirect_users_after_login', 10, 1 ); | |
/** | |
* Filter the url redirection after user authenticates with Google. | |
**/ |
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 | |
/** | |
* Returns the primary term for the chosen taxonomy set by Yoast SEO | |
* or the first term selected. | |
* | |
* @link https://www.tannerrecord.com/how-to-get-yoasts-primary-category/ | |
* @param integer $post The post id. | |
* @param string $taxonomy The taxonomy to query. Defaults to category. | |
* @return array The term with keys of 'title', 'slug', and 'url'. | |
*/ |
OlderNewer