churchthemes / church-theme-framework

A library of code useful for developing church WordPress themes that use the Church Content plugin.
https://churchthemes.com/guides/developer/framework/
GNU General Public License v2.0
31 stars 13 forks source link

Change filter for map icon #4

Closed chriswallace closed 9 years ago

chriswallace commented 10 years ago

Would it be possible to change the map icon filter to wrap around the color function like so?

'icon' => apply_filters( 'ctfw_maps_icon_color_file', ctfw_color_url( 'images/map-icon.png' ) ),

This will make it easier on us to override the changes made by the ctfw_color_url() function.

Long-term, I would love to see all the customization and color functionality removed from the framework, as we use our own Sass customization functionality.

stevengliebe commented 10 years ago

That filter is for changing the relative URL. Is it an option for you to use the ctfw_color_url filter to change the absolute URL? If not I could add a filter specifically for the absolute URL or maybe the array as a whole, but I wonder if filtering ctfw_color_url would not be more fundamentally useful.

It looks like you've discovered the framework requires its color scheming structure to be used for the maps to work out of the box. Have you found this with other features? My goal was to make something where just about everything is optional so maybe there are some adjustments that can be made.

Does your theme use the Customizer?

stevengliebe commented 9 years ago

I don't know if you're still using this or working with a fork but I removed the icon requiring use of color schemes in 1.6. You can specify a map icon globally via JavaScript now. Something like...

// Global marker image
var ctfw_map_marker_image = whatever.theme_url + '/images/map-marker.png';
var ctfw_map_marker_image_hidpi = whatever.theme_url + '/images/map-marker@2x.png';
var ctfw_map_marker_image_width = 50; // only necessary when providing HiDPI image
var ctfw_map_marker_image_height = 50;

The theme I'm working on now isn't going to use color schemes so I may end up making other changes.