Skip to content

Instantly share code, notes, and snippets.

@ProjectKarol
ProjectKarol / webpack.config.dev.js
Created May 31, 2021 09:24 — forked from timurcatakli/webpack.config.dev.js
Webpack Configuration Files for Create-React-App v2
'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');
@ProjectKarol
ProjectKarol / functions.php
Created December 9, 2018 17:18 — forked from mgibbs189/functions.php
Map facet - dynamic icon based on an ACF field
<?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 );
@ProjectKarol
ProjectKarol / 01_Query_Arguments.php
Created December 4, 2018 16:43 — forked from mgibbs189/01_Query_Arguments.php
FacetWP - show both a Google Map and a result listings
<?php
return array(
"post_type" => "park",
"post_status" => "publish",
"posts_per_page" => 100
);
@ProjectKarol
ProjectKarol / facetwp_geomywp_indexing.php
Created December 4, 2018 10:03
facetwp index geo my wordpress latitude/longitute
<?php
/**
* select post type in the map or proximity facet as the datasource, this is just a placeholder
* looks up lat/lng from GEO my WordPress plugin tables
* do a full re-index in facetwp's settings to update the indexed values after adding code
*/
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'my_map_facet' == $params['facet_name'] ) { // be sure to change this to the name of your facet
global $wpdb;
@ProjectKarol
ProjectKarol / test.php
Created December 3, 2018 23:37 — forked from mgibbs189/test.php
FacetWP - index lat/long from the "Geo My WP" plugin
<?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 : '';
@ProjectKarol
ProjectKarol / Simple way to integrate Geo My WP witch BP profile Search
Last active May 1, 2018 14:31
Simple way to integrate Geo My WP witch BP profile Search