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
stages: | |
- deploy | |
deploy_production: | |
stage: deploy | |
image: tetraweb/php:7.1 | |
when: manual | |
before_script: | |
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' | |
- eval $(ssh-agent -s) |
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
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | |
/* IE 10+ CSS Overides Here */ | |
} | |
@supports (-ms-ime-align: auto) { | |
/* Pre-Chromium MS Edge Overides Here */ | |
} |
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 | |
// For the custom post type 'communities', a custom option exists to allow editors to select 'plans' (from another custom post type) that are associated with the community post. Depending on data being displayed on the frontend, storing this data with 'plans' can potentially eliminate expensive database queries from being neccessary, especially in reguards to AJAX search. The function below syncs data with associated 'plan' posts once a community is saved or updated. This does not take into account certain scenarios, such as plans being trashed or restored. Ideally, you'd take those into account and also add a cleanup task to wp_cron to occasionally unset and rebuild the associations. | |
function sync_community_data( $id, $post ) { | |
if ( ( 'communities' == $post->post_type ) && ( $id ) ) { | |
$associated = get_post_meta( $id, 'plans', true ); | |
$associated = ( is_array( $associated ) ? $associated : array() ); | |
// First, find plans currently tied to the community, and remove the community ID if the plan |
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
add_filter('relevanssi_do_not_index', 'mytheme_noindex_old_events', 10, 2); | |
function mytheme_noindex_old_events($block, $post_id) { | |
$events_to_exclude; | |
$result = wp_cache_get( 'old_events' ); | |
if ( false === $result ) { | |
$events = tribe_get_events( array( | |
'start_date' => date( 'Y-m-d H:i:s', strtotime( '-5 years' ) ), | |
'end_date' => date( 'Y-m-d H:i:s', strtotime( '-1 day' ) ), | |
'eventDisplay' => 'custom', | |
'posts_per_page' => 99999 |
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 | |
/** | |
* Import the Wordpress oEmbed class into a function in functions.php to retreive a full object instead of just the source code | |
* @author Rob Clark | |
* | |
* | |
* What's returned: (May vary by API) | |
* | |
* $embed_data->author_url | |
* $embed_data->author_name |
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 | |
/** | |
* Include metabox only on the default page template (page.php). Heavily based of Ed Townend's front-page solution | |
* @author Rob Clark | |
* | |
* @param bool $display | |
* @param array $meta_box | |
* @return bool display metabox | |
*/ | |
function cmb2_metabox_include_default_page( $display, $meta_box ) { |