This file contains hidden or 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 path = require('path'); | |
const webpack = require('webpack'); | |
const PnpWebpackPlugin = require('pnp-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); | |
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); | |
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); |
This file contains hidden or 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( 'facetwp_map_marker_args', function( $args, $post_id ) { | |
$field = get_field( 'type_opport', $post_id ); // Get this post's ACF value | |
$icon = $field[0]; // get the first value (assuming this is an array) | |
$args['icon'] = 'https://URL/TO/' . $icon . '.png'; | |
return $args; | |
}, 10, 2 ); |
This file contains hidden or 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 | |
return array( | |
"post_type" => "park", | |
"post_status" => "publish", | |
"posts_per_page" => 100 | |
); |
This file contains hidden or 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 the following into the Custom Hooks plugin | |
add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'geo' == $params['facet_name'] ) { | |
global $wpdb; | |
$post_id = (int) $params['post_id']; | |
$coords = $wpdb->get_row( "SELECT `lat`, `long` FROM {$wpdb->prefix}places_locator WHERE post_id = '$post_id' LIMIT 1" ); | |
$params['facet_value'] = ( null !== $coords ) ? $coords->lat : ''; | |
$params['facet_display_value'] = ( null !== $coords ) ? $coords->long : ''; |