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 | |
// https://github.com/algolia/algoliasearch-wordpress/blob/master/includes/indices/class-algolia-searchable-posts-index.php#L82 | |
// Replace | |
$post_content = apply_filters( 'the_content', $post->post_content ); | |
// With | |
$post_content = $post->post_content; | |
// Same change on this file | |
// https://github.com/algolia/algoliasearch-wordpress/blob/master/includes/indices/class-algolia-posts-index.php#L92 | |
// Replace |
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_filter( 'algolia_post_shared_attributes', 'exclude_event_attributes', 10, 2 ); | |
function exclude_event_attributes(array $shared_attributes, WP_Post $post) { | |
unset($shared_attributes['comment_count']); | |
unset($shared_attributes['record_index']); | |
unset($shared_attributes['is_sticky']); | |
unset($shared_attributes['post_mime_type']); | |
unset($shared_attributes['menu_order']); | |
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
import Vue from 'vue'; | |
import InstantSearch from 'vue-instantsearch'; | |
Vue.use(InstantSearch); |
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
<template> | |
<div> | |
<ais-index :search-store="searchStore1"></ais-index> | |
<ais-index :search-store="searchStore2"></ais-index> | |
<your-map-component :results="combinedResults"></your-map-component> | |
</div> | |
</template> | |
<script> |
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
<ais-refinement-list attribute-name="Source_type" inline-template> | |
<div v-if="show"> | |
<template v-for="facet in facetValues" :key="facet.name"> | |
<div class="input-checkbox"> | |
<input | |
type="checkbox" | |
v-model="facet.isRefined" | |
@change="toggleRefinement(facet)" | |
:value="facet.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
<template> | |
<ais-index :search-store="searchStore"> | |
<ais-input></ais-input> | |
<ais-results v-show="searchStore.query.length > 0"></ais-results> | |
</ais-index> | |
</template> | |
<script> | |
import { createFromAlgoliaCredentials } from 'vue-instantsearch'; |
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 | |
namespace Mamdauka\WpQuerySpeed\Command; | |
use WP_CLI; | |
use WP_CLI\Utils; | |
use WP_CLI_Command; | |
use WP_Query; | |
use Symfony\Component\Stopwatch\Stopwatch; |
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 | |
if (php_sapi_name() !== 'cli') { | |
die("Meant to be run from command line"); | |
} | |
function find_wordpress_base_path() | |
{ | |
$dir = dirname(__FILE__); | |
do { |
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 | |
// To be added to the functions.php file of your active theme. | |
function vm_post_shared_attributes(array $shared_attributes, WP_Post $post) | |
{ | |
if ($shared_attributes['post_type_label'] === 'Posts') { | |
$shared_attributes['post_type_label'] = 'Videos'; | |
} | |
return $shared_attributes; | |
} |
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
.anchor { | |
float: left; | |
padding-right: 4px; | |
margin-left: -20px; | |
display: none; | |
} | |
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor { | |
display: inline; | |
} |