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 | |
// START COPYING HERE... | |
// Requires Beaver Builder v2.1.4 and newer! | |
/** | |
* Populates CSS classes dropdown selector with custom classes selection. | |
* | |
* Hooks onto `fl_builder_field_js_config` filter hook. See Beaver Builder code directly | |
* for filter hook attributes (in `classes/class-fl-builder-ui-settings-forms.php` file). |
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
/** | |
* Beaver Themer: WooCommeece Module: | |
* Single category archive page template for WooCommerce | |
* | |
* You get a checkbox saying autoselect parent, | |
* when it's set to true, the parent_id field gets hidden | |
* and the parent_id will be automatically set, when it's false the user can enter a parent_id | |
*/ | |
add_filter('fl_builder_before_render_module', function($module) { |
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
/*========== In Pods Template, Use Function on Field Output ==========*/ | |
{@legend_items,add_icons} | |
/*========== Add to functions.php ==========*/ | |
function add_icons($items) { | |
// loop through items | |
foreach ($items as $item) : |
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 | |
/** | |
** look up and index a value from a post relationship field | |
** set the datasource to the relationship field | |
** get the post id of that related post and use it to | |
** lookup its associated value | |
** for ACF you may want get_field() instead of get_post_meta() | |
** remember to do a full re-index after adding code | |
** check the wp_facetwp_index table if needed to see what values are being indexed | |
**/ |
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 | |
/** index a serialized checkbox | |
** run reindex after adding code to your site | |
**/ | |
add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'my_facet' == $params['facet_name'] ) { // change my_facet to name of your facet | |
$values = maybe_unserialize( $params['facet_value'] ); | |
if ( is_array( $values ) && ! empty( $values ) ) { | |
foreach ( $values as $value ) { |
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 | |
/** | |
* Plugin initialization file | |
* | |
* @package WP_Plugin_MU_Loader | |
* @since 1.0.0 | |
* | |
* @wordpress-plugin | |
* Plugin Name: WP Plugin MU Loader | |
* Plugin URI: https://gist.github.com/felixarntz/daff4006112b60dfea677ca08fc0b31c |
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
# Source: https://www.websavers.org/how-to-speed-up-wordpress/ | |
rewrite !\.(js|ico|gif|jpg|png|css|pdf|mov|mp3|eot|svg|ttf|woff|otf|txt|swf)$ /index.php break; | |
rewrite /wp-admin/$ /wp-admin/index.php break; | |
rewrite /$ /index.php break; | |
# enable gzip compression | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 32k; | |
gzip_types text/plain application/x-javascript text/xml text/css; |
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 display name / role for post locking dialogs. | |
* | |
* @param array $response The Heartbeat response. | |
* @param array $data The $_POST data sent. | |
* @param string $screen_id The screen id. | |
* | |
* @return array The Heartbeat response. |
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 | |
/** | |
* Filter the Pods saving process and run actions / modify values | |
* | |
* @param array $pieces An array of different variables you can *change*, see below | |
* | |
* List of $pieces variables includes: | |
* | |
* array $pieces['fields'] An array of fields on the Pod, 'value' key stores the *new* value if it's been set to save | |
* |